Expand description

This crate provides OCaml grammars for the tree-sitter parsing library. There are separate grammars for implementation (.ml) and interface (.mli) files.

Typically, you will use the language_ocaml function to add this grammar to a tree-sitter Parser, and then use the parser to parse some code:

let code = r#"
  module M = struct
    let x = 0
  end
"#;
let mut parser = tree_sitter::Parser::new();
parser
    .set_language(tree_sitter_ocaml::language_ocaml())
    .expect("Error loading OCaml grammar");
let tree = parser.parse(code, None).unwrap();

Constants

Functions