Crate tree_sitter_tlaplus

Crate tree_sitter_tlaplus 

Source
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 LanguageFn for this grammar.
LOCALS_QUERY
NODE_TYPES
The content of the node-types.json file for this grammar.