#tree-sitter #parser #incremental #godot-resource

tree-sitter-godot-resource

Grammar for the Godot game engine's resource format

1 unstable release

new 0.6.1 Jan 28, 2025

#171 in Parser tooling

Download history 73/week @ 2025-01-24

73 downloads per month

MIT license

65KB
2.5K SLoC

C 2K SLoC // 0.0% comments JavaScript 75 SLoC // 0.3% comments Rust 30 SLoC // 0.2% comments

tree-sitter-godot-resource

Godot resource grammar for tree-sitter.

Parses tscn and tres files.


lib.rs:

This crate provides GodotResource 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_godot_resource::LANGUAGE;
parser
    .set_language(&language.into())
    .expect("Error loading GodotResource parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());

Dependencies

~4–310KB