Expand description
This crate provides an OCamllex grammar for the tree-sitter parsing library.
Typically, you will use the LANGUAGE constant to add this language
to a tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
rule main = parse
| _ { "" }
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_ocamllex::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading OCamllex language");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());Constantsยง
- HIGHLIGHTS_
QUERY - The syntax highlighting query for OCamllex.
- INJECTIONS_
QUERY - The injections query for OCamllex.
- LANGUAGE
- The tree-sitter
LanguageFnfor OCamllex. - NODE_
TYPES - The content of the
node-types.jsonfile for OCamllex.