Giter Club home page Giter Club logo

mafrosis / ocaml-tree-sitter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zeta1999/ocaml-tree-sitter

0.0 2.0 0.0 1.44 MB

Generate OCaml parsers based on tree-sitter grammars.

License: GNU General Public License v3.0

OCaml 37.08% Shell 8.32% JavaScript 13.09% Makefile 1.08% Reason 1.25% C++ 1.84% Standard ML 1.11% C 6.06% Dockerfile 0.23% Java 0.34% Ruby 0.79% TypeScript 0.52% Python 0.93% C# 2.90% Go 23.73% Kotlin 0.37% Lua 0.37% Rebol 0.01% Rust 0.01%

ocaml-tree-sitter's Introduction

ocaml-tree-sitter

CircleCI

Generate OCaml parsers based on tree-sitter grammars, for semgrep.

Installation

Installing ocaml-tree-sitter alone isn't of great use at the moment. It is useful as part of the flow for generating OCaml parsers from tree-sitter grammars, which is done from the lang/ folder. See the Contributing instructions below.

Contributing

Development setup

  1. Install opam.
  2. Install ocaml dev tools for your favorite editor: typically opam install merlin + some plugin for your editor.
  3. Install pre-commit with pip3 install pre-commit and run pre-commit install to set up the pre-commit hook. This will re-indent code in a consistent fashion each time you call git commit.
  4. Check out the extra instructions for MacOS.

For building or rebuilding everything after big changes, use this script:

./scripts/rebuild-everything  # needs root access to install libtree-sitter

Testing a language

Say you want to build and test support for kotlin, you would run this:

$ cd lang
$ ./test-lang kotlin

For details, see How to upgrade the grammar for a language.

Adding a new language

See How to add support for a new language.

Documentation

We have limited documentation which is mostly targeted at early contributors. It's growing organically based on demand, so don't hesitate to file an issue explaining what you're trying to do.

License

ocaml-tree-sitter is free software with contributors from multiple organizations. The project is driven by r2c.

  • OCaml code developed specifically for this project is distributed under the terms of the GNU GPL v3.
  • The OCaml bindings to tree-sitter's C API were created by Bryan Phelps as part of the reason-tree-sitter project.
  • The tree-sitter grammars for major programming languages are external projects. Each comes with its own license.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.