@willbooster/tree-sitter-rust 1.1.16 → 1.2.1
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/grammar.js +56 -57
- package/package.json +1 -1
- package/queries/highlights.scm +3 -0
- package/queries/injections.scm +6 -0
- package/queries/tags.scm +6 -0
- package/src/node-types.json +225 -240
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -121,9 +121,11 @@ module.exports = grammar({
|
|
|
121
121
|
$._line_doc_content,
|
|
122
122
|
$._range_unary_endpoint_start,
|
|
123
123
|
$._error_sentinel,
|
|
124
|
+
$._foreign_declaration_context,
|
|
125
|
+
$._foreign_declaration_start,
|
|
124
126
|
],
|
|
125
127
|
|
|
126
|
-
supertypes: ($) => [$._expression, $._type, $._literal, $._literal_pattern, $._pattern],
|
|
128
|
+
supertypes: ($) => [$._declaration_statement, $._expression, $._type, $._literal, $._literal_pattern, $._pattern],
|
|
127
129
|
|
|
128
130
|
inline: ($) => [
|
|
129
131
|
$._path,
|
|
@@ -131,7 +133,6 @@ module.exports = grammar({
|
|
|
131
133
|
$._tokens,
|
|
132
134
|
$._field_identifier,
|
|
133
135
|
$._non_special_token,
|
|
134
|
-
$._declaration_statement,
|
|
135
136
|
$._reserved_identifier,
|
|
136
137
|
$._expression_ending_with_block,
|
|
137
138
|
],
|
|
@@ -166,6 +167,7 @@ module.exports = grammar({
|
|
|
166
167
|
$.const_item,
|
|
167
168
|
$.macro_invocation,
|
|
168
169
|
$.macro_definition,
|
|
170
|
+
$.decl_macro,
|
|
169
171
|
$.empty_statement,
|
|
170
172
|
$.attribute_item,
|
|
171
173
|
$.inner_attribute_item,
|
|
@@ -179,15 +181,16 @@ module.exports = grammar({
|
|
|
179
181
|
$.function_signature_item,
|
|
180
182
|
$.impl_item,
|
|
181
183
|
$.trait_item,
|
|
184
|
+
$.trait_alias,
|
|
182
185
|
$.associated_type,
|
|
183
186
|
$.let_declaration,
|
|
184
187
|
$.use_declaration,
|
|
185
188
|
$.extern_crate_declaration,
|
|
186
|
-
$.static_item
|
|
189
|
+
$.static_item,
|
|
190
|
+
alias($._safe_function_signature_item, $.function_signature_item),
|
|
191
|
+
alias($._qualified_static_item, $.static_item)
|
|
187
192
|
),
|
|
188
193
|
|
|
189
|
-
// Section - Macro definitions
|
|
190
|
-
|
|
191
194
|
macro_definition: ($) => {
|
|
192
195
|
const rules = seq(repeat(seq($.macro_rule, ';')), optional($.macro_rule));
|
|
193
196
|
|
|
@@ -198,6 +201,15 @@ module.exports = grammar({
|
|
|
198
201
|
);
|
|
199
202
|
},
|
|
200
203
|
|
|
204
|
+
decl_macro: ($) =>
|
|
205
|
+
seq(
|
|
206
|
+
optional($.visibility_modifier),
|
|
207
|
+
'macro',
|
|
208
|
+
field('name', choice($.identifier, $._reserved_identifier)),
|
|
209
|
+
field('parameters', optional(alias($._parenthesized_token_tree, $.token_tree))),
|
|
210
|
+
field('body', alias($._braced_token_tree, $.token_tree))
|
|
211
|
+
),
|
|
212
|
+
|
|
201
213
|
macro_rule: ($) => seq(field('left', $.token_tree_pattern), '=>', field('right', $.token_tree)),
|
|
202
214
|
|
|
203
215
|
_token_pattern: ($) =>
|
|
@@ -247,9 +259,6 @@ module.exports = grammar({
|
|
|
247
259
|
|
|
248
260
|
token_repetition: ($) => seq('$', '(', repeat($._tokens), ')', optional(/[^+*?]+/), choice('+', '*', '?')),
|
|
249
261
|
|
|
250
|
-
// Matches non-delimiter tokens common to both macro invocations and
|
|
251
|
-
// definitions. This is everything except $ and metavariables (which begin
|
|
252
|
-
// with $).
|
|
253
262
|
_non_special_token: ($) =>
|
|
254
263
|
choice(
|
|
255
264
|
$._literal,
|
|
@@ -291,8 +300,6 @@ module.exports = grammar({
|
|
|
291
300
|
'while'
|
|
292
301
|
),
|
|
293
302
|
|
|
294
|
-
// Section - Declarations
|
|
295
|
-
|
|
296
303
|
attribute_item: ($) => seq('#', '[', $.attribute, ']'),
|
|
297
304
|
|
|
298
305
|
inner_attribute_item: ($) => seq('#', '!', '[', $.attribute, ']'),
|
|
@@ -322,31 +329,31 @@ module.exports = grammar({
|
|
|
322
329
|
|
|
323
330
|
declaration_list: ($) => seq('{', repeat($._declaration_statement), '}'),
|
|
324
331
|
|
|
325
|
-
//
|
|
326
|
-
//
|
|
327
|
-
// an identifier
|
|
332
|
+
// The scanner never emits `_foreign_declaration_context`: its validity enables the zero-width
|
|
333
|
+
// `_foreign_declaration_start` required by qualified extern items. Keep this context marker so `safe` remains
|
|
334
|
+
// an identifier outside extern blocks while qualified items still participate in declaration supertype queries.
|
|
328
335
|
_foreign_declaration_list: ($) =>
|
|
329
|
-
seq(
|
|
330
|
-
'{',
|
|
331
|
-
repeat(
|
|
332
|
-
choice(
|
|
333
|
-
$._declaration_statement,
|
|
334
|
-
alias($._safe_function_signature_item, $.function_signature_item),
|
|
335
|
-
alias($._qualified_static_item, $.static_item)
|
|
336
|
-
)
|
|
337
|
-
),
|
|
338
|
-
'}'
|
|
339
|
-
),
|
|
336
|
+
seq('{', repeat(seq(optional($._foreign_declaration_context), $._declaration_statement)), '}'),
|
|
340
337
|
|
|
341
338
|
_safe_function_signature_item: ($) =>
|
|
342
|
-
seq(
|
|
339
|
+
seq(
|
|
340
|
+
$._foreign_declaration_start,
|
|
341
|
+
optional($.visibility_modifier),
|
|
342
|
+
alias($._safe_modifier, $.function_modifiers),
|
|
343
|
+
$._function_signature
|
|
344
|
+
),
|
|
343
345
|
|
|
344
346
|
// Aliasing the bare token instead would make `function_modifiers` a leaf without the `safe` child that other
|
|
345
347
|
// modifiers have.
|
|
346
348
|
_safe_modifier: () => 'safe',
|
|
347
349
|
|
|
348
350
|
_qualified_static_item: ($) =>
|
|
349
|
-
seq(
|
|
351
|
+
seq(
|
|
352
|
+
$._foreign_declaration_start,
|
|
353
|
+
optional($.visibility_modifier),
|
|
354
|
+
choice('safe', 'unsafe'),
|
|
355
|
+
$._static_declaration
|
|
356
|
+
),
|
|
350
357
|
|
|
351
358
|
struct_item: ($) =>
|
|
352
359
|
seq(
|
|
@@ -536,6 +543,22 @@ module.exports = grammar({
|
|
|
536
543
|
field('body', $.declaration_list)
|
|
537
544
|
),
|
|
538
545
|
|
|
546
|
+
trait_alias: ($) =>
|
|
547
|
+
seq(
|
|
548
|
+
optional($.visibility_modifier),
|
|
549
|
+
optional('const'),
|
|
550
|
+
'trait',
|
|
551
|
+
field('name', $._type_identifier),
|
|
552
|
+
field('type_parameters', optional($.type_parameters)),
|
|
553
|
+
'=',
|
|
554
|
+
field('bounds', optional($.trait_alias_bounds)),
|
|
555
|
+
optional($.where_clause),
|
|
556
|
+
';'
|
|
557
|
+
),
|
|
558
|
+
|
|
559
|
+
trait_alias_bounds: ($) =>
|
|
560
|
+
seq(sepBy1('+', choice($._type, $.lifetime, $.higher_ranked_trait_bound)), optional('+')),
|
|
561
|
+
|
|
539
562
|
associated_type: ($) =>
|
|
540
563
|
seq(
|
|
541
564
|
'type',
|
|
@@ -637,8 +660,6 @@ module.exports = grammar({
|
|
|
637
660
|
visibility_modifier: ($) =>
|
|
638
661
|
choice($.crate, seq('pub', optional(seq('(', choice($.self, $.super, $.crate, seq('in', $._path)), ')')))),
|
|
639
662
|
|
|
640
|
-
// Section - Types
|
|
641
|
-
|
|
642
663
|
_type: ($) =>
|
|
643
664
|
choice(
|
|
644
665
|
$.abstract_type,
|
|
@@ -783,8 +804,6 @@ module.exports = grammar({
|
|
|
783
804
|
|
|
784
805
|
mutable_specifier: () => 'mut',
|
|
785
806
|
|
|
786
|
-
// Section - Expressions
|
|
787
|
-
|
|
788
807
|
_expression_except_range: ($) =>
|
|
789
808
|
choice(
|
|
790
809
|
$.unary_expression,
|
|
@@ -853,15 +872,14 @@ module.exports = grammar({
|
|
|
853
872
|
),
|
|
854
873
|
|
|
855
874
|
delim_token_tree: ($) =>
|
|
856
|
-
choice(
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
875
|
+
choice($._parenthesized_token_tree, seq('[', repeat($._delim_tokens), ']'), $._braced_token_tree),
|
|
876
|
+
|
|
877
|
+
_parenthesized_token_tree: ($) => seq('(', repeat($._delim_tokens), ')'),
|
|
878
|
+
|
|
879
|
+
_braced_token_tree: ($) => seq('{', repeat($._delim_tokens), '}'),
|
|
861
880
|
|
|
862
881
|
_delim_tokens: ($) => choice($._non_delim_token, alias($.delim_token_tree, $.token_tree)),
|
|
863
882
|
|
|
864
|
-
// Should match any token other than a delimiter.
|
|
865
883
|
_non_delim_token: ($) => choice($._non_special_token, '$'),
|
|
866
884
|
|
|
867
885
|
scoped_identifier: ($) =>
|
|
@@ -1144,8 +1162,6 @@ module.exports = grammar({
|
|
|
1144
1162
|
|
|
1145
1163
|
block: ($) => seq(optional(seq($.label, ':')), '{', repeat($._statement), optional($._expression), '}'),
|
|
1146
1164
|
|
|
1147
|
-
// Section - Patterns
|
|
1148
|
-
|
|
1149
1165
|
_pattern: ($) =>
|
|
1150
1166
|
choice(
|
|
1151
1167
|
$._literal_pattern,
|
|
@@ -1226,8 +1242,6 @@ module.exports = grammar({
|
|
|
1226
1242
|
|
|
1227
1243
|
or_pattern: ($) => prec.left(-2, choice(seq($._pattern, '|', $._pattern), seq('|', $._pattern))),
|
|
1228
1244
|
|
|
1229
|
-
// Section - Literals
|
|
1230
|
-
|
|
1231
1245
|
_literal: ($) =>
|
|
1232
1246
|
choice(
|
|
1233
1247
|
$.string_literal,
|
|
@@ -1315,16 +1329,9 @@ module.exports = grammar({
|
|
|
1315
1329
|
|
|
1316
1330
|
line_comment: ($) =>
|
|
1317
1331
|
seq(
|
|
1318
|
-
// All line comments start with two //
|
|
1319
1332
|
'//',
|
|
1320
|
-
// Then are followed by:
|
|
1321
|
-
// - 2 or more slashes making it a regular comment
|
|
1322
|
-
// - 1 slash or 1 or more bang operators making it a doc comment
|
|
1323
|
-
// - or just content for the comment
|
|
1324
1333
|
choice(
|
|
1325
|
-
// A tricky edge case where what looks like a doc comment is not
|
|
1326
1334
|
seq(token.immediate(prec(2, /\/\//)), /.*/),
|
|
1327
|
-
// A regular doc comment
|
|
1328
1335
|
seq($._line_doc_comment_marker, field('doc', alias($._line_doc_content, $.doc_comment))),
|
|
1329
1336
|
token.immediate(prec(1, /.*/))
|
|
1330
1337
|
)
|
|
@@ -1332,9 +1339,7 @@ module.exports = grammar({
|
|
|
1332
1339
|
|
|
1333
1340
|
_line_doc_comment_marker: ($) =>
|
|
1334
1341
|
choice(
|
|
1335
|
-
// An outer line doc comment applies to the element that it is outside of
|
|
1336
1342
|
field('outer', alias($._outer_line_doc_comment_marker, $.outer_doc_comment_marker)),
|
|
1337
|
-
// An inner line doc comment applies to the element it is inside of
|
|
1338
1343
|
field('inner', alias($._inner_line_doc_comment_marker, $.inner_doc_comment_marker))
|
|
1339
1344
|
),
|
|
1340
1345
|
|
|
@@ -1346,9 +1351,7 @@ module.exports = grammar({
|
|
|
1346
1351
|
'/*',
|
|
1347
1352
|
optional(
|
|
1348
1353
|
choice(
|
|
1349
|
-
// Documentation block comments: /** docs */ or /*! docs */
|
|
1350
1354
|
seq($._block_doc_comment_marker, optional(field('doc', alias($._block_comment_content, $.doc_comment)))),
|
|
1351
|
-
// Non-doc block comments
|
|
1352
1355
|
$._block_comment_content
|
|
1353
1356
|
)
|
|
1354
1357
|
),
|
|
@@ -1392,9 +1395,7 @@ module.exports = grammar({
|
|
|
1392
1395
|
});
|
|
1393
1396
|
|
|
1394
1397
|
/**
|
|
1395
|
-
*
|
|
1396
|
-
*
|
|
1397
|
-
* @param {RuleOrLiteral} sep - The separator to use.
|
|
1398
|
+
* @param {RuleOrLiteral} sep
|
|
1398
1399
|
* @param {RuleOrLiteral} rule
|
|
1399
1400
|
*
|
|
1400
1401
|
* @returns {SeqRule}
|
|
@@ -1404,9 +1405,7 @@ function sepBy1(sep, rule) {
|
|
|
1404
1405
|
}
|
|
1405
1406
|
|
|
1406
1407
|
/**
|
|
1407
|
-
*
|
|
1408
|
-
*
|
|
1409
|
-
* @param {RuleOrLiteral} sep - The separator to use.
|
|
1408
|
+
* @param {RuleOrLiteral} sep
|
|
1410
1409
|
* @param {RuleOrLiteral} rule
|
|
1411
1410
|
*
|
|
1412
1411
|
* @returns {ChoiceRule}
|
package/package.json
CHANGED
package/queries/highlights.scm
CHANGED
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
macro: (identifier) @function.macro
|
|
63
63
|
"!" @function.macro)
|
|
64
64
|
|
|
65
|
+
(decl_macro name: (identifier) @function.macro)
|
|
66
|
+
|
|
65
67
|
; Function definitions
|
|
66
68
|
|
|
67
69
|
(function_item (identifier) @function)
|
|
@@ -117,6 +119,7 @@
|
|
|
117
119
|
"let" @keyword
|
|
118
120
|
"loop" @keyword
|
|
119
121
|
"macro_rules!" @keyword
|
|
122
|
+
"macro" @keyword
|
|
120
123
|
"match" @keyword
|
|
121
124
|
"mod" @keyword
|
|
122
125
|
"move" @keyword
|
package/queries/injections.scm
CHANGED
|
@@ -7,3 +7,9 @@
|
|
|
7
7
|
(token_tree) @injection.content)
|
|
8
8
|
(#set! injection.language "rust")
|
|
9
9
|
(#set! injection.include-children))
|
|
10
|
+
|
|
11
|
+
((decl_macro
|
|
12
|
+
parameters: (token_tree)
|
|
13
|
+
body: (token_tree) @injection.content)
|
|
14
|
+
(#set! injection.language "rust")
|
|
15
|
+
(#set! injection.include-children))
|
package/queries/tags.scm
CHANGED
|
@@ -29,6 +29,9 @@
|
|
|
29
29
|
(trait_item
|
|
30
30
|
name: (type_identifier) @name) @definition.interface
|
|
31
31
|
|
|
32
|
+
(trait_alias
|
|
33
|
+
name: (type_identifier) @name) @definition.interface
|
|
34
|
+
|
|
32
35
|
; module definitions
|
|
33
36
|
(mod_item
|
|
34
37
|
name: (identifier) @name) @definition.module
|
|
@@ -38,6 +41,9 @@
|
|
|
38
41
|
(macro_definition
|
|
39
42
|
name: (identifier) @name) @definition.macro
|
|
40
43
|
|
|
44
|
+
(decl_macro
|
|
45
|
+
name: (identifier) @name) @definition.macro
|
|
46
|
+
|
|
41
47
|
; references
|
|
42
48
|
|
|
43
49
|
(call_expression
|
package/src/node-types.json
CHANGED
|
@@ -1,4 +1,102 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"type": "_declaration_statement",
|
|
4
|
+
"named": true,
|
|
5
|
+
"subtypes": [
|
|
6
|
+
{
|
|
7
|
+
"type": "associated_type",
|
|
8
|
+
"named": true
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"type": "attribute_item",
|
|
12
|
+
"named": true
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "const_item",
|
|
16
|
+
"named": true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "decl_macro",
|
|
20
|
+
"named": true
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"type": "empty_statement",
|
|
24
|
+
"named": true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "enum_item",
|
|
28
|
+
"named": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"type": "extern_crate_declaration",
|
|
32
|
+
"named": true
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"type": "foreign_mod_item",
|
|
36
|
+
"named": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"type": "function_item",
|
|
40
|
+
"named": true
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "function_signature_item",
|
|
44
|
+
"named": true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "impl_item",
|
|
48
|
+
"named": true
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"type": "inner_attribute_item",
|
|
52
|
+
"named": true
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "let_declaration",
|
|
56
|
+
"named": true
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"type": "macro_definition",
|
|
60
|
+
"named": true
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "macro_invocation",
|
|
64
|
+
"named": true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "mod_item",
|
|
68
|
+
"named": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "static_item",
|
|
72
|
+
"named": true
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"type": "struct_item",
|
|
76
|
+
"named": true
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"type": "trait_alias",
|
|
80
|
+
"named": true
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"type": "trait_item",
|
|
84
|
+
"named": true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "type_item",
|
|
88
|
+
"named": true
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"type": "union_item",
|
|
92
|
+
"named": true
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"type": "use_declaration",
|
|
96
|
+
"named": true
|
|
97
|
+
}
|
|
98
|
+
]
|
|
99
|
+
},
|
|
2
100
|
{
|
|
3
101
|
"type": "_expression",
|
|
4
102
|
"named": true,
|
|
@@ -807,96 +905,20 @@
|
|
|
807
905
|
"required": false,
|
|
808
906
|
"types": [
|
|
809
907
|
{
|
|
810
|
-
"type": "
|
|
811
|
-
"named": true
|
|
812
|
-
},
|
|
813
|
-
{
|
|
814
|
-
"type": "associated_type",
|
|
815
|
-
"named": true
|
|
816
|
-
},
|
|
817
|
-
{
|
|
818
|
-
"type": "attribute_item",
|
|
908
|
+
"type": "_declaration_statement",
|
|
819
909
|
"named": true
|
|
820
910
|
},
|
|
821
911
|
{
|
|
822
|
-
"type": "
|
|
823
|
-
"named": true
|
|
824
|
-
},
|
|
825
|
-
{
|
|
826
|
-
"type": "empty_statement",
|
|
827
|
-
"named": true
|
|
828
|
-
},
|
|
829
|
-
{
|
|
830
|
-
"type": "enum_item",
|
|
912
|
+
"type": "_expression",
|
|
831
913
|
"named": true
|
|
832
914
|
},
|
|
833
915
|
{
|
|
834
916
|
"type": "expression_statement",
|
|
835
917
|
"named": true
|
|
836
918
|
},
|
|
837
|
-
{
|
|
838
|
-
"type": "extern_crate_declaration",
|
|
839
|
-
"named": true
|
|
840
|
-
},
|
|
841
|
-
{
|
|
842
|
-
"type": "foreign_mod_item",
|
|
843
|
-
"named": true
|
|
844
|
-
},
|
|
845
|
-
{
|
|
846
|
-
"type": "function_item",
|
|
847
|
-
"named": true
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
"type": "function_signature_item",
|
|
851
|
-
"named": true
|
|
852
|
-
},
|
|
853
|
-
{
|
|
854
|
-
"type": "impl_item",
|
|
855
|
-
"named": true
|
|
856
|
-
},
|
|
857
|
-
{
|
|
858
|
-
"type": "inner_attribute_item",
|
|
859
|
-
"named": true
|
|
860
|
-
},
|
|
861
919
|
{
|
|
862
920
|
"type": "label",
|
|
863
921
|
"named": true
|
|
864
|
-
},
|
|
865
|
-
{
|
|
866
|
-
"type": "let_declaration",
|
|
867
|
-
"named": true
|
|
868
|
-
},
|
|
869
|
-
{
|
|
870
|
-
"type": "macro_definition",
|
|
871
|
-
"named": true
|
|
872
|
-
},
|
|
873
|
-
{
|
|
874
|
-
"type": "mod_item",
|
|
875
|
-
"named": true
|
|
876
|
-
},
|
|
877
|
-
{
|
|
878
|
-
"type": "static_item",
|
|
879
|
-
"named": true
|
|
880
|
-
},
|
|
881
|
-
{
|
|
882
|
-
"type": "struct_item",
|
|
883
|
-
"named": true
|
|
884
|
-
},
|
|
885
|
-
{
|
|
886
|
-
"type": "trait_item",
|
|
887
|
-
"named": true
|
|
888
|
-
},
|
|
889
|
-
{
|
|
890
|
-
"type": "type_item",
|
|
891
|
-
"named": true
|
|
892
|
-
},
|
|
893
|
-
{
|
|
894
|
-
"type": "union_item",
|
|
895
|
-
"named": true
|
|
896
|
-
},
|
|
897
|
-
{
|
|
898
|
-
"type": "use_declaration",
|
|
899
|
-
"named": true
|
|
900
922
|
}
|
|
901
923
|
]
|
|
902
924
|
}
|
|
@@ -1453,6 +1475,52 @@
|
|
|
1453
1475
|
]
|
|
1454
1476
|
}
|
|
1455
1477
|
},
|
|
1478
|
+
{
|
|
1479
|
+
"type": "decl_macro",
|
|
1480
|
+
"named": true,
|
|
1481
|
+
"fields": {
|
|
1482
|
+
"body": {
|
|
1483
|
+
"multiple": false,
|
|
1484
|
+
"required": true,
|
|
1485
|
+
"types": [
|
|
1486
|
+
{
|
|
1487
|
+
"type": "token_tree",
|
|
1488
|
+
"named": true
|
|
1489
|
+
}
|
|
1490
|
+
]
|
|
1491
|
+
},
|
|
1492
|
+
"name": {
|
|
1493
|
+
"multiple": false,
|
|
1494
|
+
"required": true,
|
|
1495
|
+
"types": [
|
|
1496
|
+
{
|
|
1497
|
+
"type": "identifier",
|
|
1498
|
+
"named": true
|
|
1499
|
+
}
|
|
1500
|
+
]
|
|
1501
|
+
},
|
|
1502
|
+
"parameters": {
|
|
1503
|
+
"multiple": false,
|
|
1504
|
+
"required": false,
|
|
1505
|
+
"types": [
|
|
1506
|
+
{
|
|
1507
|
+
"type": "token_tree",
|
|
1508
|
+
"named": true
|
|
1509
|
+
}
|
|
1510
|
+
]
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
"children": {
|
|
1514
|
+
"multiple": false,
|
|
1515
|
+
"required": false,
|
|
1516
|
+
"types": [
|
|
1517
|
+
{
|
|
1518
|
+
"type": "visibility_modifier",
|
|
1519
|
+
"named": true
|
|
1520
|
+
}
|
|
1521
|
+
]
|
|
1522
|
+
}
|
|
1523
|
+
},
|
|
1456
1524
|
{
|
|
1457
1525
|
"type": "declaration_list",
|
|
1458
1526
|
"named": true,
|
|
@@ -1462,87 +1530,7 @@
|
|
|
1462
1530
|
"required": false,
|
|
1463
1531
|
"types": [
|
|
1464
1532
|
{
|
|
1465
|
-
"type": "
|
|
1466
|
-
"named": true
|
|
1467
|
-
},
|
|
1468
|
-
{
|
|
1469
|
-
"type": "attribute_item",
|
|
1470
|
-
"named": true
|
|
1471
|
-
},
|
|
1472
|
-
{
|
|
1473
|
-
"type": "const_item",
|
|
1474
|
-
"named": true
|
|
1475
|
-
},
|
|
1476
|
-
{
|
|
1477
|
-
"type": "empty_statement",
|
|
1478
|
-
"named": true
|
|
1479
|
-
},
|
|
1480
|
-
{
|
|
1481
|
-
"type": "enum_item",
|
|
1482
|
-
"named": true
|
|
1483
|
-
},
|
|
1484
|
-
{
|
|
1485
|
-
"type": "extern_crate_declaration",
|
|
1486
|
-
"named": true
|
|
1487
|
-
},
|
|
1488
|
-
{
|
|
1489
|
-
"type": "foreign_mod_item",
|
|
1490
|
-
"named": true
|
|
1491
|
-
},
|
|
1492
|
-
{
|
|
1493
|
-
"type": "function_item",
|
|
1494
|
-
"named": true
|
|
1495
|
-
},
|
|
1496
|
-
{
|
|
1497
|
-
"type": "function_signature_item",
|
|
1498
|
-
"named": true
|
|
1499
|
-
},
|
|
1500
|
-
{
|
|
1501
|
-
"type": "impl_item",
|
|
1502
|
-
"named": true
|
|
1503
|
-
},
|
|
1504
|
-
{
|
|
1505
|
-
"type": "inner_attribute_item",
|
|
1506
|
-
"named": true
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
"type": "let_declaration",
|
|
1510
|
-
"named": true
|
|
1511
|
-
},
|
|
1512
|
-
{
|
|
1513
|
-
"type": "macro_definition",
|
|
1514
|
-
"named": true
|
|
1515
|
-
},
|
|
1516
|
-
{
|
|
1517
|
-
"type": "macro_invocation",
|
|
1518
|
-
"named": true
|
|
1519
|
-
},
|
|
1520
|
-
{
|
|
1521
|
-
"type": "mod_item",
|
|
1522
|
-
"named": true
|
|
1523
|
-
},
|
|
1524
|
-
{
|
|
1525
|
-
"type": "static_item",
|
|
1526
|
-
"named": true
|
|
1527
|
-
},
|
|
1528
|
-
{
|
|
1529
|
-
"type": "struct_item",
|
|
1530
|
-
"named": true
|
|
1531
|
-
},
|
|
1532
|
-
{
|
|
1533
|
-
"type": "trait_item",
|
|
1534
|
-
"named": true
|
|
1535
|
-
},
|
|
1536
|
-
{
|
|
1537
|
-
"type": "type_item",
|
|
1538
|
-
"named": true
|
|
1539
|
-
},
|
|
1540
|
-
{
|
|
1541
|
-
"type": "union_item",
|
|
1542
|
-
"named": true
|
|
1543
|
-
},
|
|
1544
|
-
{
|
|
1545
|
-
"type": "use_declaration",
|
|
1533
|
+
"type": "_declaration_statement",
|
|
1546
1534
|
"named": true
|
|
1547
1535
|
}
|
|
1548
1536
|
]
|
|
@@ -3751,96 +3739,16 @@
|
|
|
3751
3739
|
"required": false,
|
|
3752
3740
|
"types": [
|
|
3753
3741
|
{
|
|
3754
|
-
"type": "
|
|
3755
|
-
"named": true
|
|
3756
|
-
},
|
|
3757
|
-
{
|
|
3758
|
-
"type": "attribute_item",
|
|
3759
|
-
"named": true
|
|
3760
|
-
},
|
|
3761
|
-
{
|
|
3762
|
-
"type": "const_item",
|
|
3763
|
-
"named": true
|
|
3764
|
-
},
|
|
3765
|
-
{
|
|
3766
|
-
"type": "empty_statement",
|
|
3767
|
-
"named": true
|
|
3768
|
-
},
|
|
3769
|
-
{
|
|
3770
|
-
"type": "enum_item",
|
|
3742
|
+
"type": "_declaration_statement",
|
|
3771
3743
|
"named": true
|
|
3772
3744
|
},
|
|
3773
3745
|
{
|
|
3774
3746
|
"type": "expression_statement",
|
|
3775
3747
|
"named": true
|
|
3776
3748
|
},
|
|
3777
|
-
{
|
|
3778
|
-
"type": "extern_crate_declaration",
|
|
3779
|
-
"named": true
|
|
3780
|
-
},
|
|
3781
|
-
{
|
|
3782
|
-
"type": "foreign_mod_item",
|
|
3783
|
-
"named": true
|
|
3784
|
-
},
|
|
3785
|
-
{
|
|
3786
|
-
"type": "function_item",
|
|
3787
|
-
"named": true
|
|
3788
|
-
},
|
|
3789
|
-
{
|
|
3790
|
-
"type": "function_signature_item",
|
|
3791
|
-
"named": true
|
|
3792
|
-
},
|
|
3793
|
-
{
|
|
3794
|
-
"type": "impl_item",
|
|
3795
|
-
"named": true
|
|
3796
|
-
},
|
|
3797
|
-
{
|
|
3798
|
-
"type": "inner_attribute_item",
|
|
3799
|
-
"named": true
|
|
3800
|
-
},
|
|
3801
|
-
{
|
|
3802
|
-
"type": "let_declaration",
|
|
3803
|
-
"named": true
|
|
3804
|
-
},
|
|
3805
|
-
{
|
|
3806
|
-
"type": "macro_definition",
|
|
3807
|
-
"named": true
|
|
3808
|
-
},
|
|
3809
|
-
{
|
|
3810
|
-
"type": "macro_invocation",
|
|
3811
|
-
"named": true
|
|
3812
|
-
},
|
|
3813
|
-
{
|
|
3814
|
-
"type": "mod_item",
|
|
3815
|
-
"named": true
|
|
3816
|
-
},
|
|
3817
3749
|
{
|
|
3818
3750
|
"type": "shebang",
|
|
3819
3751
|
"named": true
|
|
3820
|
-
},
|
|
3821
|
-
{
|
|
3822
|
-
"type": "static_item",
|
|
3823
|
-
"named": true
|
|
3824
|
-
},
|
|
3825
|
-
{
|
|
3826
|
-
"type": "struct_item",
|
|
3827
|
-
"named": true
|
|
3828
|
-
},
|
|
3829
|
-
{
|
|
3830
|
-
"type": "trait_item",
|
|
3831
|
-
"named": true
|
|
3832
|
-
},
|
|
3833
|
-
{
|
|
3834
|
-
"type": "type_item",
|
|
3835
|
-
"named": true
|
|
3836
|
-
},
|
|
3837
|
-
{
|
|
3838
|
-
"type": "union_item",
|
|
3839
|
-
"named": true
|
|
3840
|
-
},
|
|
3841
|
-
{
|
|
3842
|
-
"type": "use_declaration",
|
|
3843
|
-
"named": true
|
|
3844
3752
|
}
|
|
3845
3753
|
]
|
|
3846
3754
|
}
|
|
@@ -4274,6 +4182,79 @@
|
|
|
4274
4182
|
]
|
|
4275
4183
|
}
|
|
4276
4184
|
},
|
|
4185
|
+
{
|
|
4186
|
+
"type": "trait_alias",
|
|
4187
|
+
"named": true,
|
|
4188
|
+
"fields": {
|
|
4189
|
+
"bounds": {
|
|
4190
|
+
"multiple": false,
|
|
4191
|
+
"required": false,
|
|
4192
|
+
"types": [
|
|
4193
|
+
{
|
|
4194
|
+
"type": "trait_alias_bounds",
|
|
4195
|
+
"named": true
|
|
4196
|
+
}
|
|
4197
|
+
]
|
|
4198
|
+
},
|
|
4199
|
+
"name": {
|
|
4200
|
+
"multiple": false,
|
|
4201
|
+
"required": true,
|
|
4202
|
+
"types": [
|
|
4203
|
+
{
|
|
4204
|
+
"type": "type_identifier",
|
|
4205
|
+
"named": true
|
|
4206
|
+
}
|
|
4207
|
+
]
|
|
4208
|
+
},
|
|
4209
|
+
"type_parameters": {
|
|
4210
|
+
"multiple": false,
|
|
4211
|
+
"required": false,
|
|
4212
|
+
"types": [
|
|
4213
|
+
{
|
|
4214
|
+
"type": "type_parameters",
|
|
4215
|
+
"named": true
|
|
4216
|
+
}
|
|
4217
|
+
]
|
|
4218
|
+
}
|
|
4219
|
+
},
|
|
4220
|
+
"children": {
|
|
4221
|
+
"multiple": true,
|
|
4222
|
+
"required": false,
|
|
4223
|
+
"types": [
|
|
4224
|
+
{
|
|
4225
|
+
"type": "visibility_modifier",
|
|
4226
|
+
"named": true
|
|
4227
|
+
},
|
|
4228
|
+
{
|
|
4229
|
+
"type": "where_clause",
|
|
4230
|
+
"named": true
|
|
4231
|
+
}
|
|
4232
|
+
]
|
|
4233
|
+
}
|
|
4234
|
+
},
|
|
4235
|
+
{
|
|
4236
|
+
"type": "trait_alias_bounds",
|
|
4237
|
+
"named": true,
|
|
4238
|
+
"fields": {},
|
|
4239
|
+
"children": {
|
|
4240
|
+
"multiple": true,
|
|
4241
|
+
"required": true,
|
|
4242
|
+
"types": [
|
|
4243
|
+
{
|
|
4244
|
+
"type": "_type",
|
|
4245
|
+
"named": true
|
|
4246
|
+
},
|
|
4247
|
+
{
|
|
4248
|
+
"type": "higher_ranked_trait_bound",
|
|
4249
|
+
"named": true
|
|
4250
|
+
},
|
|
4251
|
+
{
|
|
4252
|
+
"type": "lifetime",
|
|
4253
|
+
"named": true
|
|
4254
|
+
}
|
|
4255
|
+
]
|
|
4256
|
+
}
|
|
4257
|
+
},
|
|
4277
4258
|
{
|
|
4278
4259
|
"type": "trait_bounds",
|
|
4279
4260
|
"named": true,
|
|
@@ -5528,6 +5509,10 @@
|
|
|
5528
5509
|
"type": "loop",
|
|
5529
5510
|
"named": false
|
|
5530
5511
|
},
|
|
5512
|
+
{
|
|
5513
|
+
"type": "macro",
|
|
5514
|
+
"named": false
|
|
5515
|
+
},
|
|
5531
5516
|
{
|
|
5532
5517
|
"type": "macro_rules!",
|
|
5533
5518
|
"named": false
|
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|