@willbooster/tree-sitter-java 7.0.0 → 7.0.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
@@ -388,7 +388,7 @@ module.exports = grammar({
388
388
  seq(
389
389
  repeat(choice($._annotation, 'final')),
390
390
  field('right', $._unannotated_type),
391
- field('name', choice($.identifier, $._reserved_identifier, $.underscore_pattern)),
391
+ field('name', choice($.identifier, $._reserved_identifier, alias('when', $.identifier), $.underscore_pattern)),
392
392
  ),
393
393
  field('right', $._type),
394
394
  field('pattern', $.record_pattern),
@@ -603,7 +603,7 @@ module.exports = grammar({
603
603
  prec.dynamic(1, seq('case', $.null_literal, ',', 'default')),
604
604
  seq('case',
605
605
  choice(
606
- $.pattern,
606
+ commaSep1($.pattern),
607
607
  commaSep1($.expression),
608
608
  ),
609
609
  optional($.guard),
@@ -615,7 +615,7 @@ module.exports = grammar({
615
615
  $.type_pattern,
616
616
  $.record_pattern,
617
617
  ),
618
- type_pattern: $ => seq(repeat(choice($._annotation, 'final')), $._unannotated_type, choice($.identifier, $._reserved_identifier, $.underscore_pattern)),
618
+ type_pattern: $ => seq(repeat(choice($._annotation, 'final')), $._unannotated_type, choice($.identifier, $._reserved_identifier, alias('when', $.identifier), $.underscore_pattern)),
619
619
  record_pattern: $ => seq(choice($.identifier, $._reserved_identifier, $.generic_type, $.scoped_type_identifier), $.record_pattern_body),
620
620
  record_pattern_body: $ => seq('(', commaSep(choice($.record_pattern_component, $.record_pattern)), ')'),
621
621
  record_pattern_component: $ => choice(
@@ -623,7 +623,7 @@ module.exports = grammar({
623
623
  seq(
624
624
  repeat(choice($._annotation, 'final')),
625
625
  $._unannotated_type,
626
- choice($.identifier, $._reserved_identifier, $.underscore_pattern),
626
+ choice($.identifier, $._reserved_identifier, alias('when', $.identifier), $.underscore_pattern),
627
627
  ),
628
628
  ),
629
629
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "7.0.0",
3
+ "version": "7.0.2",
4
4
  "description": "Java grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -14,7 +14,7 @@
14
14
  }
15
15
  ],
16
16
  "metadata": {
17
- "version": "7.0.0",
17
+ "version": "7.0.2",
18
18
  "license": "MIT",
19
19
  "description": "Java grammar for tree-sitter",
20
20
  "authors": [