1 unstable release
0.1.0 | Apr 23, 2023 |
---|---|
0.0.0 |
|
#329 in Text editors
40 downloads per month
Used in loxcraft
165KB
6.5K
SLoC
tree-sitter-lox
A Lox grammar for the tree-sitter parsing library.
Local setup
Install tree-sitter-cli
:
cargo install tree-sitter-cli
To generate bindings:
tree-sitter generate
To run tests:
tree-sitter test
References
lib.rs
:
This crate provides Lox 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 = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_lox::language()).expect("error loading Lox grammar");
let tree = parser.parse(code, None).unwrap();
Dependencies
~2.7–4MB
~75K SLoC