2 unstable releases
0.3.0 | Oct 4, 2024 |
---|---|
0.2.2 | Sep 29, 2024 |
#132 in Text editors
316 downloads per month
195KB
6K
SLoC
tree-sitter-fsm
This package describes the tree-sitter grammar used for generating parsers to interpret FSM. FSM is a new DSL to describe typed state machines for ECMAScript.
For more information, see the tree-sitter usage guide and the FSM repository
lib.rs
:
This crate provides Fsm 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:
let code = r#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_fsm::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading Fsm parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());
Dependencies
~225KB