Metadata-Version: 2.4
Name: tree-sitter-iml
Version: 0.26.0
Summary: IML (Imandra Modeling Language) grammar for tree-sitter
License-Expression: MIT
Project-URL: Homepage, https://github.com/imandra-ai/tree-sitter-iml
Keywords: incremental,parsing,tree-sitter,iml
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Compilers
Classifier: Topic :: Text Processing :: Linguistic
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: core
Requires-Dist: tree-sitter~=0.24; extra == "core"
Dynamic: license-file

# tree-sitter-iml

This module provides [IML (Imandra Modeling Language)](https://docs.imandra.ai/imandrax/) grammars for the [tree-sitter][] parsing library. It's based on the [tree-sitter-ocaml](https://github.com/tree-sitter/tree-sitter-ocaml) grammar.

## Installation

```sh
pip install tree-sitter-iml
```

You will probably also need the [tree-sitter binding][tree-sitter binding].

```sh
pip install tree-sitter
```

## Usage

Load the grammar as a `Language` object:

```python
import tree_sitter_iml
from tree_sitter import Language, Parser

language_iml = Language(tree_sitter_iml.language_iml())
```

Create a `Parser` and configure it to use the language:

```python
parser = Parser(language_iml)
```

Parse some source code:

```python
tree = parser.parse(iml_code)
```

Use `language_iml()` for IML files, `language_ocaml()` for OCaml files,
`language_ocaml_interface()` to parse interface files (with `.mli` extension),
and `language_ocaml_type()` to parse type signatures.
