9 releases

0.1.8 Oct 24, 2024
0.1.7 Oct 23, 2024

#107 in Text editors

MIT license

260KB
9K SLoC

C 9K SLoC JavaScript 342 SLoC // 0.0% comments Scheme 63 SLoC Rust 27 SLoC // 0.3% comments

tree-sitter-flatbuffers

Commands

Format

npx prettier . --write

Generate

npx tree-sitter generate

Test

npx tree-sitter test

lib.rs:

This crate provides Flatbuffers language support 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#"
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_flatbuffers::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading Flatbuffers parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~2–300KB