@willbooster/tree-sitter-rust 3.1.9 → 3.1.10
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 -4
- package/package.json +1 -1
- package/src/node-types.json +4 -0
- package/tree-sitter-rust.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -160,6 +160,8 @@ module.exports = grammar({
|
|
|
160
160
|
],
|
|
161
161
|
|
|
162
162
|
conflicts: ($) => [
|
|
163
|
+
[$.type_parameters, $.for_lifetimes],
|
|
164
|
+
[$.lifetime_parameter, $.for_lifetimes],
|
|
163
165
|
[$._token_pattern, $.token_repetition_pattern],
|
|
164
166
|
[$.token_tree, $.token_repetition],
|
|
165
167
|
[$.field_initializer_list, $.block],
|
|
@@ -664,7 +666,8 @@ module.exports = grammar({
|
|
|
664
666
|
seq(':', optional(seq(sepBy1('+', choice($._type, $.lifetime, $.higher_ranked_trait_bound)), optional('+'))))
|
|
665
667
|
),
|
|
666
668
|
|
|
667
|
-
higher_ranked_trait_bound: ($) =>
|
|
669
|
+
higher_ranked_trait_bound: ($) =>
|
|
670
|
+
prec.dynamic(1, seq('for', field('type_parameters', $.type_parameters), field('type', $._type))),
|
|
668
671
|
|
|
669
672
|
removed_trait_bound: ($) => seq('?', $._type),
|
|
670
673
|
|
|
@@ -794,7 +797,7 @@ module.exports = grammar({
|
|
|
794
797
|
|
|
795
798
|
array_type: ($) => seq('[', field('element', $._type), optional(seq(';', field('length', $._expression))), ']'),
|
|
796
799
|
|
|
797
|
-
for_lifetimes: ($) => seq('for', '<', optional(seq(sepBy1(',', $.lifetime), optional(','))), '>'),
|
|
800
|
+
for_lifetimes: ($) => prec(1, seq('for', '<', optional(seq(sepBy1(',', prec(1, $.lifetime)), optional(','))), '>')),
|
|
798
801
|
|
|
799
802
|
function_type: ($) =>
|
|
800
803
|
seq(
|
|
@@ -874,7 +877,14 @@ module.exports = grammar({
|
|
|
874
877
|
),
|
|
875
878
|
|
|
876
879
|
bounded_type: ($) =>
|
|
877
|
-
prec.left(
|
|
880
|
+
prec.left(
|
|
881
|
+
-1,
|
|
882
|
+
seq(
|
|
883
|
+
choice($.lifetime, $._type, $.use_bounds),
|
|
884
|
+
'+',
|
|
885
|
+
choice($.lifetime, $._type, $.use_bounds, prec.dynamic(-2, $.higher_ranked_trait_bound))
|
|
886
|
+
)
|
|
887
|
+
),
|
|
878
888
|
|
|
879
889
|
use_bounds: ($) =>
|
|
880
890
|
seq('use', token(prec(1, '<')), sepBy(',', choice($.lifetime, $._type_identifier)), optional(','), '>'),
|
|
@@ -917,7 +927,7 @@ module.exports = grammar({
|
|
|
917
927
|
abstract_type: ($) =>
|
|
918
928
|
seq(
|
|
919
929
|
'impl',
|
|
920
|
-
optional(seq('for', $.type_parameters)),
|
|
930
|
+
optional(prec.dynamic(1, seq('for', $.type_parameters))),
|
|
921
931
|
field(
|
|
922
932
|
'trait',
|
|
923
933
|
prec(
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-rust.wasm
CHANGED
|
Binary file
|