Skip to main content

OCaml grammar for tree-sitter

Project description

tree-sitter-ocaml

CI pypi

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tree_sitter_ocaml-0.25.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

tree_sitter_ocaml-0.25.0-cp310-abi3-win_arm64.whl (661.1 kB view details)

Uploaded CPython 3.10+Windows ARM64

tree_sitter_ocaml-0.25.0-cp310-abi3-win_amd64.whl (665.3 kB view details)

Uploaded CPython 3.10+Windows x86-64

tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_x86_64.whl (714.2 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_aarch64.whl (712.2 kB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (715.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl (713.7 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64manylinux: glibc 2.28+ ARM64

tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_11_0_arm64.whl (711.2 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_10_9_x86_64.whl (663.5 kB view details)

Uploaded CPython 3.10+macOS 10.9+ x86-64

File details

Details for the file tree_sitter_ocaml-0.25.0.tar.gz.

File metadata

  • Download URL: tree_sitter_ocaml-0.25.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tree_sitter_ocaml-0.25.0.tar.gz
Algorithm Hash digest
SHA256 f5833261dd85cf170da2bb4dd0273e138bf488f1d6937d38c511b2918c19a51e
MD5 276f85e9cade6d57b29b698689c1d710
BLAKE2b-256 7e51eab58652cc54221192a82bb0cb2c7ce50954e2b18db4fcfb8791d6dfd7fe

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 e370b50ddbc1de652966a78697258d21a26d59a618ff5807cd343811a480372e
MD5 d8e16c2daab344caf3ef42f72aae02ff
BLAKE2b-256 4f05ea0517c683cb5572dd8bd688e119bddbb8d2fd3974fcb1db00e724fa836b

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 e0b41127fb602878e757c25f2ecc451688f82f909102f422e782a9b7d4fb3ff0
MD5 0e515d521fb5baad642f38e23f37561f
BLAKE2b-256 8d595263f0209a9fc31a53aeaa2d7be02bb0cab6420b04fa5dee58800929d6c7

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 72ead1435b43d8434c93e9e71c0429d74e90b5005dfcc43cb7776ae4842a110a
MD5 4cbe771d4925d6dbae98f42cb6e40f8c
BLAKE2b-256 3b031e0563fff25f21d9d67b7f6edb60a260c19dc9a22f5b0b03700f6b585471

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 8fa32599619e21026d21145d0a1af4a6ef17b36d51c2b9ba9dc470ea5d301047
MD5 637d605c1e18ad5170b0b245944f594a
BLAKE2b-256 e9e10f7fc18d3b2e02630b266fee6c2f3416460623746da786cd712a82012036

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f7897e35905f851a4465674f88cfe116e58b99d0e60630ad82a211a115402a7d
MD5 e8c2ac67746739b4060f826d824c4074
BLAKE2b-256 34b70c67840dfa5e2f3a1c5536c0c9f946a7f573a42fdfd2b2a57fd3d88cabdc

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2035b643ff801c0a1023026284bb462bbc002f98f577395ade660faf21ff65db
MD5 5f24a967bf4243f4bb665062c46e7326
BLAKE2b-256 1bc88edd26733d1fe67eb781fd35910c8f22e2f115a941993d8367076f78222c

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b376fda33b092befd9cc889b2d1f71d5fca643daff04255990580b563ccea63f
MD5 588d142d9a4cda80bcc43a6547202189
BLAKE2b-256 0704bdd1257dae21cc1172aed235f7f4e908a21d826d303d5d961e9c566ab2e5

See more details on using hashes here.

File details

Details for the file tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for tree_sitter_ocaml-0.25.0-cp310-abi3-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ee544bb2c28926e173d78de2ba210c8093fc73cc897da9d93fc9062a9be9695f
MD5 ad59a5bcac27cb5911812004da7f375f
BLAKE2b-256 60c60184e6872f24e8ad1eab26e7c9dee6e5ac7980b1cfe4885095453f946579

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page