@willbooster/tree-sitter-java 3.0.1 → 3.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 +13 -5
- package/package.json +1 -1
- package/src/node-types.json +30 -2
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -72,6 +72,10 @@ module.exports = grammar({
|
|
|
72
72
|
],
|
|
73
73
|
|
|
74
74
|
conflicts: $ => [
|
|
75
|
+
[$._literal, $.switch_label],
|
|
76
|
+
[$.dimensions],
|
|
77
|
+
[$.array_type, $._unannotated_type],
|
|
78
|
+
[$.array_type, $.primary_expression],
|
|
75
79
|
[$.modifiers, $.annotated_type, $.receiver_parameter],
|
|
76
80
|
[$.modifiers, $.annotated_type, $.module_declaration, $.package_declaration],
|
|
77
81
|
[$._unannotated_type, $.primary_expression, $.inferred_parameters],
|
|
@@ -474,9 +478,9 @@ module.exports = grammar({
|
|
|
474
478
|
seq($.super, $._type),
|
|
475
479
|
),
|
|
476
480
|
|
|
477
|
-
dimensions: $ =>
|
|
481
|
+
dimensions: $ => repeat1(
|
|
478
482
|
seq(repeat($._annotation), '[', ']'),
|
|
479
|
-
)
|
|
483
|
+
),
|
|
480
484
|
|
|
481
485
|
switch_expression: $ => seq(
|
|
482
486
|
'switch',
|
|
@@ -505,6 +509,7 @@ module.exports = grammar({
|
|
|
505
509
|
),
|
|
506
510
|
|
|
507
511
|
switch_label: $ => choice(
|
|
512
|
+
prec.dynamic(1, seq('case', $.null_literal, ',', 'default')),
|
|
508
513
|
seq('case',
|
|
509
514
|
choice(
|
|
510
515
|
$.pattern,
|
|
@@ -634,7 +639,10 @@ module.exports = grammar({
|
|
|
634
639
|
$._variable_declarator_id,
|
|
635
640
|
),
|
|
636
641
|
|
|
637
|
-
catch_type: $ =>
|
|
642
|
+
catch_type: $ => seq(
|
|
643
|
+
$._unannotated_type,
|
|
644
|
+
repeat(seq('|', $._type)),
|
|
645
|
+
),
|
|
638
646
|
|
|
639
647
|
finally_clause: $ => seq('finally', $.block),
|
|
640
648
|
|
|
@@ -1175,7 +1183,7 @@ module.exports = grammar({
|
|
|
1175
1183
|
)),
|
|
1176
1184
|
|
|
1177
1185
|
array_type: $ => seq(
|
|
1178
|
-
field('element', $.
|
|
1186
|
+
field('element', $._simple_type),
|
|
1179
1187
|
field('dimensions', $.dimensions),
|
|
1180
1188
|
),
|
|
1181
1189
|
|
|
@@ -1240,8 +1248,8 @@ module.exports = grammar({
|
|
|
1240
1248
|
spread_parameter: $ => seq(
|
|
1241
1249
|
optional($.modifiers),
|
|
1242
1250
|
$._unannotated_type,
|
|
1243
|
-
'...',
|
|
1244
1251
|
repeat($._annotation),
|
|
1252
|
+
'...',
|
|
1245
1253
|
$.variable_declarator,
|
|
1246
1254
|
),
|
|
1247
1255
|
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -735,7 +735,31 @@
|
|
|
735
735
|
"required": true,
|
|
736
736
|
"types": [
|
|
737
737
|
{
|
|
738
|
-
"type": "
|
|
738
|
+
"type": "boolean_type",
|
|
739
|
+
"named": true
|
|
740
|
+
},
|
|
741
|
+
{
|
|
742
|
+
"type": "floating_point_type",
|
|
743
|
+
"named": true
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"type": "generic_type",
|
|
747
|
+
"named": true
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
"type": "integral_type",
|
|
751
|
+
"named": true
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"type": "scoped_type_identifier",
|
|
755
|
+
"named": true
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
"type": "type_identifier",
|
|
759
|
+
"named": true
|
|
760
|
+
},
|
|
761
|
+
{
|
|
762
|
+
"type": "void_type",
|
|
739
763
|
"named": true
|
|
740
764
|
}
|
|
741
765
|
]
|
|
@@ -1093,7 +1117,7 @@
|
|
|
1093
1117
|
"required": true,
|
|
1094
1118
|
"types": [
|
|
1095
1119
|
{
|
|
1096
|
-
"type": "
|
|
1120
|
+
"type": "_type",
|
|
1097
1121
|
"named": true
|
|
1098
1122
|
}
|
|
1099
1123
|
]
|
|
@@ -3572,6 +3596,10 @@
|
|
|
3572
3596
|
"type": "guard",
|
|
3573
3597
|
"named": true
|
|
3574
3598
|
},
|
|
3599
|
+
{
|
|
3600
|
+
"type": "null_literal",
|
|
3601
|
+
"named": true
|
|
3602
|
+
},
|
|
3575
3603
|
{
|
|
3576
3604
|
"type": "pattern",
|
|
3577
3605
|
"named": true
|
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|