@willbooster/tree-sitter-java 7.0.1 → 7.0.3

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),
@@ -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
 
@@ -665,7 +665,7 @@ module.exports = grammar({
665
665
  ),
666
666
 
667
667
  labeled_statement: $ => seq(
668
- $.identifier, ':', $.statement,
668
+ choice($.identifier, $._reserved_identifier), ':', $.statement,
669
669
  ),
670
670
 
671
671
  assert_statement: $ => choice(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "7.0.1",
3
+ "version": "7.0.3",
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.1",
17
+ "version": "7.0.3",
18
18
  "license": "MIT",
19
19
  "description": "Java grammar for tree-sitter",
20
20
  "authors": [