2 unstable releases

0.3.0 Oct 4, 2024
0.2.2 Sep 29, 2024

#169 in Text editors

Download history 262/week @ 2024-09-28 52/week @ 2024-10-05 2/week @ 2024-10-12

147 downloads per month

LGPL-3.0-or-later

195KB
6K SLoC

C 6K SLoC JavaScript 138 SLoC // 0.0% comments Scheme 39 SLoC Rust 27 SLoC // 0.3% comments

tree-sitter-fsm

NPM Version Crates.io Version

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

~2–285KB