@willbooster/tree-sitter-java 3.0.4 → 3.1.0

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
@@ -102,7 +102,6 @@ module.exports = grammar({
102
102
  $.method_declaration,
103
103
  ),
104
104
 
105
-
106
105
  _literal: $ => choice(
107
106
  $.decimal_integer_literal,
108
107
  $.hex_integer_literal,
@@ -226,7 +225,6 @@ module.exports = grammar({
226
225
 
227
226
  null_literal: _ => 'null',
228
227
 
229
-
230
228
  expression: $ => choice(
231
229
  $.assignment_expression,
232
230
  $.binary_expression,
@@ -538,7 +536,6 @@ module.exports = grammar({
538
536
 
539
537
  guard: $ => seq('when', $.expression),
540
538
 
541
-
542
539
  statement: $ => choice(
543
540
  $.declaration,
544
541
  $.expression_statement,
@@ -706,7 +703,6 @@ module.exports = grammar({
706
703
  field('body', $.statement),
707
704
  ),
708
705
 
709
-
710
706
  _annotation: $ => choice(
711
707
  $.marker_annotation,
712
708
  $.annotation,
@@ -751,7 +747,6 @@ module.exports = grammar({
751
747
  '}',
752
748
  ),
753
749
 
754
-
755
750
  declaration: $ => prec(PREC.DECL, choice(
756
751
  $.module_declaration,
757
752
  $.package_declaration,
@@ -843,9 +838,10 @@ module.exports = grammar({
843
838
 
844
839
  import_declaration: $ => seq(
845
840
  'import',
846
- optional('static'),
847
- $._name,
848
- optional(seq('.', $.asterisk)),
841
+ choice(
842
+ seq('module', $._name),
843
+ seq(optional('static'), $._name, optional(seq('.', $.asterisk))),
844
+ ),
849
845
  ';',
850
846
  ),
851
847
 
@@ -981,8 +977,8 @@ module.exports = grammar({
981
977
 
982
978
  constructor_body: $ => seq(
983
979
  '{',
984
- optional($.explicit_constructor_invocation),
985
980
  repeat($.statement),
981
+ optional(seq($.explicit_constructor_invocation, repeat($.statement))),
986
982
  '}',
987
983
  ),
988
984
 
@@ -1131,7 +1127,6 @@ module.exports = grammar({
1131
1127
  '}',
1132
1128
  ),
1133
1129
 
1134
-
1135
1130
  _type: $ => choice(
1136
1131
  $._unannotated_type,
1137
1132
  $.annotated_type,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
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": "3.0.4",
17
+ "version": "3.1.0",
18
18
  "license": "MIT",
19
19
  "description": "Java grammar for tree-sitter",
20
20
  "authors": [