@willbooster/tree-sitter-rust 3.1.1 → 3.1.2

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
@@ -676,14 +676,18 @@ module.exports = grammar({
676
676
  1,
677
677
  seq(
678
678
  '<',
679
- sepBy1(
680
- ',',
679
+ optional(
681
680
  seq(
682
- repeat($.attribute_item),
683
- choice($.metavariable, $.type_parameter, $.lifetime_parameter, $.const_parameter)
681
+ sepBy1(
682
+ ',',
683
+ seq(
684
+ repeat($.attribute_item),
685
+ choice($.metavariable, $.type_parameter, $.lifetime_parameter, $.const_parameter)
686
+ )
687
+ ),
688
+ optional(',')
684
689
  )
685
690
  ),
686
- optional(','),
687
691
  '>'
688
692
  )
689
693
  ),
@@ -786,7 +790,7 @@ module.exports = grammar({
786
790
 
787
791
  array_type: ($) => seq('[', field('element', $._type), optional(seq(';', field('length', $._expression))), ']'),
788
792
 
789
- for_lifetimes: ($) => seq('for', '<', sepBy1(',', $.lifetime), optional(','), '>'),
793
+ for_lifetimes: ($) => seq('for', '<', optional(seq(sepBy1(',', $.lifetime), optional(','))), '>'),
790
794
 
791
795
  function_type: ($) =>
792
796
  seq(
@@ -874,14 +878,18 @@ module.exports = grammar({
874
878
  type_arguments: ($) =>
875
879
  seq(
876
880
  token(prec(1, '<')),
877
- sepBy1(
878
- ',',
879
- choice(
880
- seq(choice($._type, $.type_binding, $.lifetime, $._literal, $.block), optional($.trait_bounds)),
881
- prec(1, seq(alias(choice(...primitiveTypes), sym('type_identifier')), $.trait_bounds))
881
+ optional(
882
+ seq(
883
+ sepBy1(
884
+ ',',
885
+ choice(
886
+ seq(choice($._type, $.type_binding, $.lifetime, $._literal, $.block), optional($.trait_bounds)),
887
+ prec(1, seq(alias(choice(...primitiveTypes), sym('type_identifier')), $.trait_bounds))
888
+ )
889
+ ),
890
+ optional(',')
882
891
  )
883
892
  ),
884
- optional(','),
885
893
  '>'
886
894
  ),
887
895
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "3.1.1",
3
+ "version": "3.1.2",
4
4
  "description": "Rust grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -2103,7 +2103,7 @@
2103
2103
  "fields": {},
2104
2104
  "children": {
2105
2105
  "multiple": true,
2106
- "required": true,
2106
+ "required": false,
2107
2107
  "types": [
2108
2108
  {
2109
2109
  "type": "lifetime",
@@ -4591,7 +4591,7 @@
4591
4591
  "fields": {},
4592
4592
  "children": {
4593
4593
  "multiple": true,
4594
- "required": true,
4594
+ "required": false,
4595
4595
  "types": [
4596
4596
  {
4597
4597
  "type": "_literal",
@@ -4774,7 +4774,7 @@
4774
4774
  "fields": {},
4775
4775
  "children": {
4776
4776
  "multiple": true,
4777
- "required": true,
4777
+ "required": false,
4778
4778
  "types": [
4779
4779
  {
4780
4780
  "type": "attribute_item",
Binary file
package/tree-sitter.json CHANGED
@@ -25,7 +25,7 @@
25
25
  }
26
26
  ],
27
27
  "metadata": {
28
- "version": "3.1.1",
28
+ "version": "3.1.2",
29
29
  "license": "MIT",
30
30
  "description": "Rust grammar for tree-sitter",
31
31
  "authors": [