@willbooster/tree-sitter-rust 3.1.7 → 3.1.8

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 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
- $._type_identifier,
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
- $._type_identifier,
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
- $._type_identifier,
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
- $._type_identifier,
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('name', choice($._type_identifier, alias(choice(...primitiveTypes), sym('type_identifier')))),
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
- $._type_identifier,
926
+ $._type_identifier_in_type_position,
923
927
  alias(choice(...primitiveTypes), sym('type_identifier')),
924
928
  $.scoped_type_identifier,
925
929
  $.removed_trait_bound,
@@ -942,7 +946,7 @@ module.exports = grammar({
942
946
  choice(
943
947
  $.higher_ranked_trait_bound,
944
948
  $.modified_trait_bound,
945
- $._type_identifier,
949
+ $._type_identifier_in_type_position,
946
950
  alias(choice(...primitiveTypes), sym('type_identifier')),
947
951
  $.scoped_type_identifier,
948
952
  $.generic_type,
@@ -1636,6 +1640,8 @@ module.exports = grammar({
1636
1640
  _reserved_identifier: ($) => alias(choice(...reservedIdentifiers, 'auto', 'macro_rules'), $.identifier),
1637
1641
 
1638
1642
  _type_identifier: ($) => alias(choice($.identifier, 'auto', 'macro_rules'), sym('type_identifier')),
1643
+ _type_identifier_in_type_position: ($) =>
1644
+ choice($._type_identifier, alias(choice(...reservedIdentifiers), sym('type_identifier'))),
1639
1645
  _field_identifier: ($) => alias($.identifier, sym('field_identifier')),
1640
1646
 
1641
1647
  self: () => 'self',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "Rust grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -25,7 +25,7 @@
25
25
  }
26
26
  ],
27
27
  "metadata": {
28
- "version": "3.1.7",
28
+ "version": "3.1.8",
29
29
  "license": "MIT",
30
30
  "description": "Rust grammar for tree-sitter",
31
31
  "authors": [