@willbooster/tree-sitter-rust 7.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 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 = "7" }
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
@@ -266,7 +266,8 @@ module.exports = grammar({
266
266
  const rules = seq(repeat(seq($.macro_rule, ';')), optional($.macro_rule));
267
267
 
268
268
  return seq(
269
- choice('macro_rules!', seq(alias('macro_rules', 'macro_rules!'), '!')),
269
+ alias('macro_rules', 'macro_rules!'),
270
+ '!',
270
271
  field('name', choice($.identifier, $._reserved_identifier)),
271
272
  choice(seq('(', rules, ')', ';'), seq('[', rules, ']', ';'), seq('{', rules, '}'))
272
273
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "7.0.0",
3
+ "version": "8.0.0",
4
4
  "description": "Rust grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -118,6 +118,7 @@
118
118
  "let" @keyword
119
119
  "loop" @keyword
120
120
  "macro_rules!" @keyword
121
+ (macro_definition "!" @keyword)
121
122
  "macro" @keyword
122
123
  "match" @keyword
123
124
  "mod" @keyword
Binary file
package/tree-sitter.json CHANGED
@@ -25,7 +25,7 @@
25
25
  }
26
26
  ],
27
27
  "metadata": {
28
- "version": "7.0.0",
28
+ "version": "8.0.0",
29
29
  "license": "MIT",
30
30
  "description": "Rust grammar for tree-sitter",
31
31
  "authors": [