tss-rust
Generated node type enums and metadata from tree-sitter-rust.
Usage
[]
= "0.1"
= "0.24"
= "0.24"
use NodeType;
use FromStr;
let node_type = from_str?;
assert_eq!;
assert_eq!;
Features
Default includes all metadata:
= "0.1"
Select specific metadata:
= { = "0.1", = false, = ["meta-named", "meta-fields"] }
Available metadata features:
meta-named- whether nodes are named in the grammarmeta-subtypes- possible subtypes for each nodemeta-fields- named fields nodes can havemeta-children- anonymous children nodes can havemeta-extra- extra node markersmeta-root- root node markers
How It Works
At build time, reads tree-sitter-rust's NODE_TYPES constant and generates:
- A
NodeTypeenum with all 280+ node types FromStrfor parsing node type stringsDisplayfor converting back to strings- Documentation linking to Rust language reference
Zero runtime dependencies - all generation happens at compile time.
Licensing
MIT licensed - see LICENSE for details.