@willbooster/tree-sitter-rust 1.6.0 → 1.7.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/grammar.js +12 -1
- package/package.json +1 -1
- package/src/node-types.json +28 -0
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -138,6 +138,8 @@ module.exports = grammar({
|
|
|
138
138
|
],
|
|
139
139
|
|
|
140
140
|
conflicts: ($) => [
|
|
141
|
+
[$.function_modifiers, $.modified_trait_bound],
|
|
142
|
+
[$.function_modifiers, $.impl_item, $.modified_trait_bound],
|
|
141
143
|
[$.const_item, $.function_modifiers],
|
|
142
144
|
// Local ambiguity due to anonymous types:
|
|
143
145
|
// See https://internals.rust-lang.org/t/pre-rfc-deprecating-anonymous-parameters/3710
|
|
@@ -523,7 +525,7 @@ module.exports = grammar({
|
|
|
523
525
|
field('type_parameters', optional($.type_parameters)),
|
|
524
526
|
optional(
|
|
525
527
|
seq(
|
|
526
|
-
optional('!'),
|
|
528
|
+
optional(choice('!', 'const', seq('~', 'const'))),
|
|
527
529
|
field('trait', choice($._type_identifier, $.scoped_type_identifier, $.generic_type)),
|
|
528
530
|
'for'
|
|
529
531
|
)
|
|
@@ -578,6 +580,12 @@ module.exports = grammar({
|
|
|
578
580
|
|
|
579
581
|
removed_trait_bound: ($) => seq('?', $._type),
|
|
580
582
|
|
|
583
|
+
modified_trait_bound: ($) =>
|
|
584
|
+
prec.dynamic(
|
|
585
|
+
-1,
|
|
586
|
+
seq(choice('const', seq('~', 'const'), seq('[', 'const', ']'), 'async'), field('type', $._type))
|
|
587
|
+
),
|
|
588
|
+
|
|
581
589
|
type_parameters: ($) =>
|
|
582
590
|
prec(
|
|
583
591
|
1,
|
|
@@ -681,6 +689,7 @@ module.exports = grammar({
|
|
|
681
689
|
$.dynamic_type,
|
|
682
690
|
$.bounded_type,
|
|
683
691
|
$.removed_trait_bound,
|
|
692
|
+
$.modified_trait_bound,
|
|
684
693
|
alias(choice(...primitiveTypes), $.primitive_type)
|
|
685
694
|
),
|
|
686
695
|
|
|
@@ -780,6 +789,7 @@ module.exports = grammar({
|
|
|
780
789
|
$._type_identifier,
|
|
781
790
|
$.scoped_type_identifier,
|
|
782
791
|
$.removed_trait_bound,
|
|
792
|
+
$.modified_trait_bound,
|
|
783
793
|
$.generic_type,
|
|
784
794
|
$.function_type,
|
|
785
795
|
$.tuple_type,
|
|
@@ -796,6 +806,7 @@ module.exports = grammar({
|
|
|
796
806
|
'trait',
|
|
797
807
|
choice(
|
|
798
808
|
$.higher_ranked_trait_bound,
|
|
809
|
+
$.modified_trait_bound,
|
|
799
810
|
$._type_identifier,
|
|
800
811
|
$.scoped_type_identifier,
|
|
801
812
|
$.generic_type,
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -445,6 +445,10 @@
|
|
|
445
445
|
"type": "metavariable",
|
|
446
446
|
"named": true
|
|
447
447
|
},
|
|
448
|
+
{
|
|
449
|
+
"type": "modified_trait_bound",
|
|
450
|
+
"named": true
|
|
451
|
+
},
|
|
448
452
|
{
|
|
449
453
|
"type": "never_type",
|
|
450
454
|
"named": true
|
|
@@ -503,6 +507,10 @@
|
|
|
503
507
|
"type": "generic_type",
|
|
504
508
|
"named": true
|
|
505
509
|
},
|
|
510
|
+
{
|
|
511
|
+
"type": "modified_trait_bound",
|
|
512
|
+
"named": true
|
|
513
|
+
},
|
|
506
514
|
{
|
|
507
515
|
"type": "removed_trait_bound",
|
|
508
516
|
"named": true
|
|
@@ -1583,6 +1591,10 @@
|
|
|
1583
1591
|
"type": "higher_ranked_trait_bound",
|
|
1584
1592
|
"named": true
|
|
1585
1593
|
},
|
|
1594
|
+
{
|
|
1595
|
+
"type": "modified_trait_bound",
|
|
1596
|
+
"named": true
|
|
1597
|
+
},
|
|
1586
1598
|
{
|
|
1587
1599
|
"type": "scoped_type_identifier",
|
|
1588
1600
|
"named": true
|
|
@@ -3085,6 +3097,22 @@
|
|
|
3085
3097
|
]
|
|
3086
3098
|
}
|
|
3087
3099
|
},
|
|
3100
|
+
{
|
|
3101
|
+
"type": "modified_trait_bound",
|
|
3102
|
+
"named": true,
|
|
3103
|
+
"fields": {
|
|
3104
|
+
"type": {
|
|
3105
|
+
"multiple": false,
|
|
3106
|
+
"required": true,
|
|
3107
|
+
"types": [
|
|
3108
|
+
{
|
|
3109
|
+
"type": "_type",
|
|
3110
|
+
"named": true
|
|
3111
|
+
}
|
|
3112
|
+
]
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
},
|
|
3088
3116
|
{
|
|
3089
3117
|
"type": "mut_pattern",
|
|
3090
3118
|
"named": true,
|
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|