@willbooster/tree-sitter-rust 3.1.7 → 3.1.9
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 +14 -7
- package/package.json +1 -1
- package/src/node-types.json +10 -0
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -151,6 +151,7 @@ module.exports = grammar({
|
|
|
151
151
|
inline: ($) => [
|
|
152
152
|
$._path,
|
|
153
153
|
$._type_identifier,
|
|
154
|
+
$._type_identifier_in_type_position,
|
|
154
155
|
$._tokens,
|
|
155
156
|
$._field_identifier,
|
|
156
157
|
$._non_special_token,
|
|
@@ -569,7 +570,7 @@ module.exports = grammar({
|
|
|
569
570
|
'left',
|
|
570
571
|
choice(
|
|
571
572
|
$.lifetime,
|
|
572
|
-
$.
|
|
573
|
+
$._type_identifier_in_type_position,
|
|
573
574
|
$.scoped_type_identifier,
|
|
574
575
|
$.generic_type,
|
|
575
576
|
alias($._generic_type_turbofish, $.generic_type),
|
|
@@ -602,7 +603,7 @@ module.exports = grammar({
|
|
|
602
603
|
field(
|
|
603
604
|
'trait',
|
|
604
605
|
choice(
|
|
605
|
-
$.
|
|
606
|
+
$._type_identifier_in_type_position,
|
|
606
607
|
alias(choice(...primitiveTypes), sym('type_identifier')),
|
|
607
608
|
$.scoped_type_identifier,
|
|
608
609
|
$.generic_type,
|
|
@@ -775,7 +776,7 @@ module.exports = grammar({
|
|
|
775
776
|
$.unit_type,
|
|
776
777
|
$.array_type,
|
|
777
778
|
$.function_type,
|
|
778
|
-
$.
|
|
779
|
+
$._type_identifier_in_type_position,
|
|
779
780
|
$.macro_invocation,
|
|
780
781
|
$.never_type,
|
|
781
782
|
$.dynamic_type,
|
|
@@ -805,7 +806,7 @@ module.exports = grammar({
|
|
|
805
806
|
field(
|
|
806
807
|
'trait',
|
|
807
808
|
choice(
|
|
808
|
-
$.
|
|
809
|
+
$._type_identifier_in_type_position,
|
|
809
810
|
$.scoped_type_identifier,
|
|
810
811
|
alias(choice(...primitiveTypes), sym('type_identifier'))
|
|
811
812
|
)
|
|
@@ -898,7 +899,10 @@ module.exports = grammar({
|
|
|
898
899
|
|
|
899
900
|
type_binding: ($) =>
|
|
900
901
|
seq(
|
|
901
|
-
field(
|
|
902
|
+
field(
|
|
903
|
+
'name',
|
|
904
|
+
choice($._type_identifier_in_type_position, alias(choice(...primitiveTypes), sym('type_identifier')))
|
|
905
|
+
),
|
|
902
906
|
field('type_arguments', optional($.type_arguments)),
|
|
903
907
|
'=',
|
|
904
908
|
field('type', $._type)
|
|
@@ -919,7 +923,7 @@ module.exports = grammar({
|
|
|
919
923
|
prec(
|
|
920
924
|
1,
|
|
921
925
|
choice(
|
|
922
|
-
$.
|
|
926
|
+
$._type_identifier_in_type_position,
|
|
923
927
|
alias(choice(...primitiveTypes), sym('type_identifier')),
|
|
924
928
|
$.scoped_type_identifier,
|
|
925
929
|
$.removed_trait_bound,
|
|
@@ -937,12 +941,13 @@ module.exports = grammar({
|
|
|
937
941
|
dynamic_type: ($) =>
|
|
938
942
|
seq(
|
|
939
943
|
'dyn',
|
|
944
|
+
repeat(seq($.lifetime, '+')),
|
|
940
945
|
field(
|
|
941
946
|
'trait',
|
|
942
947
|
choice(
|
|
943
948
|
$.higher_ranked_trait_bound,
|
|
944
949
|
$.modified_trait_bound,
|
|
945
|
-
$.
|
|
950
|
+
$._type_identifier_in_type_position,
|
|
946
951
|
alias(choice(...primitiveTypes), sym('type_identifier')),
|
|
947
952
|
$.scoped_type_identifier,
|
|
948
953
|
$.generic_type,
|
|
@@ -1636,6 +1641,8 @@ module.exports = grammar({
|
|
|
1636
1641
|
_reserved_identifier: ($) => alias(choice(...reservedIdentifiers, 'auto', 'macro_rules'), $.identifier),
|
|
1637
1642
|
|
|
1638
1643
|
_type_identifier: ($) => alias(choice($.identifier, 'auto', 'macro_rules'), sym('type_identifier')),
|
|
1644
|
+
_type_identifier_in_type_position: ($) =>
|
|
1645
|
+
choice($._type_identifier, alias(choice(...reservedIdentifiers), sym('type_identifier'))),
|
|
1639
1646
|
_field_identifier: ($) => alias($.identifier, sym('field_identifier')),
|
|
1640
1647
|
|
|
1641
1648
|
self: () => 'self',
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|