@willbooster/tree-sitter-rust 8.0.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/grammar.js +3 -2
- package/package.json +1 -1
- package/queries/highlights.scm +2 -0
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ fuzzed with. The parser requires version 7.0.5 or later within major version 7 o
|
|
|
74
74
|
```toml
|
|
75
75
|
[dependencies]
|
|
76
76
|
tree-sitter = { package = "willbooster-tree-sitter", version = "7.0.5" }
|
|
77
|
-
tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "
|
|
77
|
+
tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "9" }
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
```rust
|
|
@@ -87,6 +87,12 @@ parser.set_language(&tree_sitter_rust::LANGUAGE.into())?;
|
|
|
87
87
|
A macro definition's anonymous `macro_rules!` node covers the `macro_rules` keyword. The `!` is a separate
|
|
88
88
|
anonymous child. A macro invocation's `macro` field contains its name, including when that name is `macro_rules`.
|
|
89
89
|
|
|
90
|
+
## Reference nodes
|
|
91
|
+
|
|
92
|
+
A joint `&&` token produces one `reference_pattern` or `reference_type` node with an anonymous `&&` child.
|
|
93
|
+
Consecutive `&` tokens separated by whitespace or comments produce nested reference nodes.
|
|
94
|
+
For a joint token, an optional lifetime and mutability describe the inner reference.
|
|
95
|
+
|
|
90
96
|
## Attributes
|
|
91
97
|
|
|
92
98
|
An attribute in an expression position can produce an `attributed_expression` node with a `value` field.
|
package/grammar.js
CHANGED
|
@@ -993,7 +993,8 @@ module.exports = grammar({
|
|
|
993
993
|
field('type', $._type)
|
|
994
994
|
),
|
|
995
995
|
|
|
996
|
-
reference_type: ($) =>
|
|
996
|
+
reference_type: ($) =>
|
|
997
|
+
seq(choice('&', '&&'), optional($.lifetime), optional($.mutable_specifier), field('type', $._type)),
|
|
997
998
|
|
|
998
999
|
pointer_type: ($) => seq('*', choice('const', $.mutable_specifier), field('type', $._type)),
|
|
999
1000
|
|
|
@@ -1583,7 +1584,7 @@ module.exports = grammar({
|
|
|
1583
1584
|
$._pattern
|
|
1584
1585
|
),
|
|
1585
1586
|
|
|
1586
|
-
reference_pattern: ($) => seq('&', optional($.mutable_specifier), $._pattern),
|
|
1587
|
+
reference_pattern: ($) => seq(choice('&', '&&'), optional($.mutable_specifier), $._pattern),
|
|
1587
1588
|
|
|
1588
1589
|
or_pattern: ($) => prec.left(-2, choice(seq($._pattern, '|', $._pattern), seq('|', $._pattern))),
|
|
1589
1590
|
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|