tree-sitter-java
tree-sitter-java copied to clipboard
Add `grammar.json` to the module as constant
Situation description
Hi there, thank you for creating this great library!
I am in a situation where it would be great to have access to the JSON representation of the grammar ( src/grammar.json) not only grammar.js which is already accessible via tree_sitter_java::GRAMMAR.
It is far easier to look up information in JSON than in the JS code which is currently available.
Proposed changes
Add the following to bindings/rust/lib.rs:
/// The source of the Java tree-sitter grammar description.
pub const GRAMMAR_JSON: &'static str = include_str!("../../src/grammar.json");