Expand description
This crate provides Tlaplus language support for the tree-sitter parsing library.
Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:
use tree_sitter::Parser;
let code = r#"
VARIABLE clock
Init == clock \in {0, 1}
Tick == IF clock = 0 THEN clock' = 1 ELSE clock' = 0
Spec == Init /\ [][Tick]_<<clock>>
"#;
let mut parser = Parser::new();
let language = tree_sitter_tlaplus::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading Tlaplus parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());Constants§
- HIGHLIGHT_
QUERY - The syntax highlighting query for this language.
- LANGUAGE
- The tree-sitter
LanguageFnfor this grammar. - LOCALS_
QUERY - NODE_
TYPES - The content of the
node-types.jsonfile for this grammar.