@willbooster/tree-sitter-rust 6.0.0 → 8.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 +6 -1
- package/grammar.js +4 -6
- package/package.json +1 -1
- package/queries/highlights.scm +1 -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 = "8" }
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
```rust
|
|
@@ -82,6 +82,11 @@ let mut parser = tree_sitter::Parser::new();
|
|
|
82
82
|
parser.set_language(&tree_sitter_rust::LANGUAGE.into())?;
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
+
## Macros
|
|
86
|
+
|
|
87
|
+
A macro definition's anonymous `macro_rules!` node covers the `macro_rules` keyword. The `!` is a separate
|
|
88
|
+
anonymous child. A macro invocation's `macro` field contains its name, including when that name is `macro_rules`.
|
|
89
|
+
|
|
85
90
|
## Attributes
|
|
86
91
|
|
|
87
92
|
An attribute in an expression position can produce an `attributed_expression` node with a `value` field.
|
package/grammar.js
CHANGED
|
@@ -195,7 +195,6 @@ module.exports = grammar({
|
|
|
195
195
|
[$._type, $._pattern],
|
|
196
196
|
[$.unit_type, $.tuple_pattern],
|
|
197
197
|
[$.scoped_identifier, $.scoped_type_identifier],
|
|
198
|
-
[$.parameters, $._pattern],
|
|
199
198
|
[$.parameters, $.tuple_struct_pattern],
|
|
200
199
|
[$.visibility_modifier],
|
|
201
200
|
[$.visibility_modifier, $.scoped_identifier, $.scoped_type_identifier],
|
|
@@ -267,7 +266,8 @@ module.exports = grammar({
|
|
|
267
266
|
const rules = seq(repeat(seq($.macro_rule, ';')), optional($.macro_rule));
|
|
268
267
|
|
|
269
268
|
return seq(
|
|
270
|
-
|
|
269
|
+
alias('macro_rules', 'macro_rules!'),
|
|
270
|
+
'!',
|
|
271
271
|
field('name', choice($.identifier, $._reserved_identifier)),
|
|
272
272
|
choice(seq('(', rules, ')', ';'), seq('[', rules, ']', ';'), seq('{', rules, '}'))
|
|
273
273
|
);
|
|
@@ -821,10 +821,7 @@ module.exports = grammar({
|
|
|
821
821
|
parameters: ($) =>
|
|
822
822
|
seq(
|
|
823
823
|
'(',
|
|
824
|
-
sepBy(
|
|
825
|
-
',',
|
|
826
|
-
seq(repeat($.attribute_item), choice($.parameter, $.self_parameter, $.variadic_parameter, '_', $._type))
|
|
827
|
-
),
|
|
824
|
+
sepBy(',', seq(repeat($.attribute_item), choice($.parameter, $.self_parameter, $.variadic_parameter, $._type))),
|
|
828
825
|
optional(','),
|
|
829
826
|
optional(alias($._orphan_doc_expression, $.attributed_expression)),
|
|
830
827
|
')'
|
|
@@ -857,6 +854,7 @@ module.exports = grammar({
|
|
|
857
854
|
$.array_type,
|
|
858
855
|
$.function_type,
|
|
859
856
|
$._type_identifier_in_type_position,
|
|
857
|
+
alias('_', sym('type_identifier')),
|
|
860
858
|
$.macro_invocation,
|
|
861
859
|
$.never_type,
|
|
862
860
|
$.dynamic_type,
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|