#parser #tree-sitter #flat-buffers #incremental

tree-sitter-flatbuffers

Flatbuffers grammar for tree-sitter

6 releases

new 0.1.5 Oct 18, 2024
0.1.4 Oct 18, 2024

#106 in Text editors

Download history 119/week @ 2024-10-04 356/week @ 2024-10-11

475 downloads per month

MIT license

255KB
9K SLoC

C 9K SLoC JavaScript 339 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

~225KB