tree-sitter-ocaml 0.19.0

OCaml grammar for the tree-sitter parsing library
Documentation

This crate provides OCaml and OCaml Interface grammars for the tree-sitter parsing library.

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:

use tree_sitter::Parser;

let code = r#"
module M = struct
let x = x
end
"#;
let mut parser = Parser::new();
parser
.set_language(tree_sitter_ocaml::language_ocaml())
.expect("Error loading ocaml grammar");
let parsed = parser.parse(code, None).unwrap();
let root = parsed.root_node();
assert!(!root.has_error());