{"id":20777545,"url":"https://github.com/semgrep/ocaml-tree-sitter-semgrep","last_synced_at":"2025-10-03T12:53:24.599Z","repository":{"id":37882155,"uuid":"237989185","full_name":"semgrep/ocaml-tree-sitter-semgrep","owner":"semgrep","description":"Generate parsers from tree-sitter grammars extended to support Semgrep patterns","archived":false,"fork":false,"pushed_at":"2025-09-25T18:35:50.000Z","size":2830,"stargazers_count":6,"open_issues_count":17,"forks_count":18,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-09-25T19:12:47.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Move","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semgrep.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-02-03T14:49:51.000Z","updated_at":"2025-09-25T18:35:52.000Z","dependencies_parsed_at":"2023-02-16T00:15:56.485Z","dependency_job_id":"d02562db-1083-48fd-b627-a440885ef244","html_url":"https://github.com/semgrep/ocaml-tree-sitter-semgrep","commit_stats":null,"previous_names":["semgrep/ocaml-tree-sitter-semgrep","returntocorp/ocaml-tree-sitter-semgrep","returntocorp/ocaml-tree-sitter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/semgrep/ocaml-tree-sitter-semgrep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Focaml-tree-sitter-semgrep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Focaml-tree-sitter-semgrep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Focaml-tree-sitter-semgrep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Focaml-tree-sitter-semgrep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semgrep","download_url":"https://codeload.github.com/semgrep/ocaml-tree-sitter-semgrep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semgrep%2Focaml-tree-sitter-semgrep/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278165677,"owners_count":25940956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-03T02:00:06.070Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-17T13:15:58.158Z","updated_at":"2025-10-03T12:53:24.567Z","avatar_url":"https://github.com/semgrep.png","language":"Move","funding_links":[],"categories":[],"sub_categories":[],"readme":"ocaml-tree-sitter-semgrep\n==\n\n[![CircleCI](https://circleci.com/gh/returntocorp/ocaml-tree-sitter-semgrep.svg?style=svg)](https://circleci.com/gh/returntocorp/ocaml-tree-sitter-semgrep)\n\nGenerate OCaml parsers based on\n[tree-sitter](https://tree-sitter.github.io/tree-sitter/) grammars,\nfor [semgrep](https://github.com/returntocorp/semgrep).\n\nRelated ocaml-tree-sitter repositories:\n* [ocaml-tree-sitter-core](https://github.com/returntocorp/ocaml-tree-sitter-core): provides the code generator that\n  takes a tree-sitter grammar and produces an OCaml library from it.\n* [ocaml-tree-sitter-languages](https://github.com/returntocorp/ocaml-tree-sitter-languages): community repository that has scripts\n  for building and publishing OCaml libraries for parsing a variety of\n  programming languages.\n* **ocaml-tree-sitter-semgrep**: this repo; same as\n  ocaml-tree-sitter-languages but extends each language with\n  constructs specific to\n  [semgrep](https://github.com/returntocorp/semgrep) patterns.\n\nContributing\n--\n\n### Development setup\n\n1. Make sure you have at least 6 GiB of free memory. More will be\n   needed for some of the grammars.\n2. Install the following tools:\n   * git\n   * GNU make\n   * pkg-config: manages the installation of tree-sitter's runtime library\n   * Node.js: JavaScript interpreter used to translate a grammar to json\n   * cargo: Rust compiler used to build `tree-sitter`\n   * [opam](https://opam.ocaml.org/doc/Install.html): OCaml package manager\n3. Run `opam init`, `opam switch create 4.12.0` to install a recent\n   version of OCaml.\n4. Install [ocaml dev tools for your favorite\n   editor](https://github.com/janestreet/install-ocaml):\n   typically `opam install merlin` + some plugin for your editor.\n5. Install `pre-commit` with `pip3 install pre-commit` and run\n   `pre-commit install` to set up the pre-commit hook.\n   This will re-indent code in a consistent fashion each time you call\n   `git commit`.\n6. Check out the [extra instructions for MacOS](https://github.com/returntocorp/ocaml-tree-sitter-core/blob/main/doc/macos.md).\n\nSee the Makefile for the available targets. Get started with:\n```\nmake update\nmake setup\n```\n\nThen build and install the OCaml code generator (core):\n```\nmake \u0026\u0026 make install\n```\n\n### Testing a language\n\nSay you want to build and test support for kotlin, you would run this:\n\n```\n$ cd lang\n$ ./test-lang kotlin\n```\n\nFor details, see [How to upgrade the grammar for a\nlanguage](https://semgrep.dev/docs/contributing/updating-a-grammar/).\n\n### Adding a new language\n\nSee [How to add support for a new language](https://semgrep.dev/docs/contributing/adding-a-language/).\n\nDocumentation\n--\n\nWe have limited [documentation](doc) which is mostly targeted at\nearly contributors. It's growing organically based on demand, so don't\nhesitate to [file an issue](https://github.com/returntocorp/ocaml-tree-sitter/issues)\nexplaining what you're trying to do.\n\nLicense\n--\n\nocaml-tree-sitter is free software with contributors from multiple\norganizations. The project is driven by [r2c](https://github.com/returntocorp).\n\n- OCaml code developed specifically for this project is\n  distributed under the terms of the [GNU GPL v3](LICENSE).\n- The OCaml bindings to tree-sitter's C API were created by Bryan\n  Phelps as part of the reason-tree-sitter project.\n- The tree-sitter grammars for major programming languages are\n  external projects. Each comes with its own license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemgrep%2Focaml-tree-sitter-semgrep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemgrep%2Focaml-tree-sitter-semgrep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemgrep%2Focaml-tree-sitter-semgrep/lists"}