OCaml grammar for tree-sitter
Project description
tree-sitter-ocaml
This module provides OCaml grammars for the tree-sitter parsing library.
There are separate grammars for implementations (.ml
), interfaces (.mli
)
and types.
Installation
pip install tree-sitter-ocaml
You will probably also need the tree-sitter binding.
pip install tree-sitter
Usage
Load the grammar as a Language
object:
import tree_sitter_ocaml
from tree_sitter import Language, Parser
language_ocaml = Language(tree_sitter_ocaml.language_ocaml())
Create a Parser
and configure it to use the language:
parser = Parser(language_ocaml)
Parse some source code:
tree = parser.parse(
b"""
module M : sig
val x : int
end
"""
)
Use language_ocaml_interface()
to parse interface files (with .mli
extension)
and language_ocaml_type()
to parse type signatures.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-win_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b8f9dbdf1ab6cacae4c7079ed01d4f441fcf65756fd06ea1257f98eb6c6df41 |
|
MD5 | e3ce584fec5c091a7b70980a86135735 |
|
BLAKE2b-256 | 5f94d2850d3b3d38a20ab9196c5a9e72b4dd94d060bf6527b64022d1483e1009 |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88caab5cb09fad08bcd2b1cec8e2b9d7ef6a3d04df40af260c8c75f7e374597f |
|
MD5 | bf9a0b27889ff51b7889974d02ef005f |
|
BLAKE2b-256 | 946f2c2b57b025245a373ba00384e5f5012b1d77e9017cd9dde762c5fae37138 |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 593a10cde645e66509f44a26c0c6f7a33889736057ade72f105d2926b2bafb11 |
|
MD5 | 110fcf2af62e5a51cf19a8324ffd66ce |
|
BLAKE2b-256 | 0df58d0efa3d198241b65e279eabbdb963d3d9a128c7cdc939bad9eb0f7fbbb6 |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9e2fdb53b87d30d97c71f29f32c531049e222622da29605fcd16c0ef15e78c5 |
|
MD5 | c1d66ff6e50066bfc4450fbce0ff39e5 |
|
BLAKE2b-256 | 5148ba44d36fbe6b34f5d8d507dc0334b57c86e05b120c7651e76a16596adc7c |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a3452a28dcc161f56db74fbb4e68696a0248d87327f05ec499d1a5d98c686f1 |
|
MD5 | 90690bd145c74134cb6f28665fb6d022 |
|
BLAKE2b-256 | fd9371aecabbc3cfde08d508afd6fbfa84e5e0f3cc8462ec485f4aa822e4ed5c |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2a115bf330e5405774004e8f6f6b069f33a06ef122f5dfc3d1b4520e59b00a2e |
|
MD5 | dad18d6ed4b1889cfd89b08474e074c0 |
|
BLAKE2b-256 | af20e2faa32c711bab17cfba374f88e6505b9951213f4ffa10474fb9fbb50a39 |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9925483bbbdb9421fa1d8358fc877c0519f815effdf0ca4cded930b5cb11c58 |
|
MD5 | 5fdc38b663ffc076271cd83f48174246 |
|
BLAKE2b-256 | c9e6cca01ee968c10ddf74f18187fb1a2a32c57e30939cf847daa3263a98a7e0 |
Close
Hashes for tree_sitter_ocaml-0.23.1-cp39-abi3-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0222f7ab20344962c9384eff9468fb67a47616209d5c27e0bb491039b8986f7a |
|
MD5 | 5cec3d507171cf78ed0598cb21e6d54e |
|
BLAKE2b-256 | 1a30e2a77a84fbe43c4840dc2f477a03ef7c4db87ab40117004b10b966d89954 |