tree-sitter-rust
tree-sitter-rust copied to clipboard
Rust grammar for tree-sitter
This PR adds box pattern to grammar. Closes #14 Added a simple test for sanity check :smile:
First time working with tree-sitter and S-expressions, would love some feedback!
I'm new to tree-sitter so I might be missing something, but it seems like an oversight that curly brackets `{ }` are missing from the `@punctuation.bracket` section of queries/highlights.scm. Please...
```rust println!("{}", &foo); ``` Here the query `"&" @operator` doesn't match the `&`, if the macro is changed for a function call it works ```rust println("{}", &foo); ```
``` vec![Foo::bar()]; baz![?]; ``` The `::` and `?` are not included in the syntax tree. I think this is because `_non_special_token` is matching these with a regular expression, unlike e.g....
Currently enum variants and constants are considered `Constructor`, but it would be great if they could be considered something else, as constructor isnt exactly accurate; enums are more like static...
currently the `as` keyword is being parsed as an operator, though it is a keyword (as per https://doc.rust-lang.org/reference/keywords.html)
Since this already supports greek characters, and that requires the feature gate `#![feature(non_ascii_idents)]` This package may as well support any unicode character as identifiers, as this feature gate allows to
I tried to run this code with `tree-sitter-rust v0.19.0` and `tree-sitter v0.19.4` ```rust for i in 0.. { if *wide.offset(i) == 0 { return Self::from_wide_ptr(wide, i as usize) } }...