@willbooster/tree-sitter-java 3.1.0 → 3.1.1
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 +80 -8
- package/package.json +1 -1
- package/src/node-types.json +12 -0
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -80,7 +80,6 @@ module.exports = grammar({
|
|
|
80
80
|
[$.modifiers, $.annotated_type, $.module_declaration, $.package_declaration],
|
|
81
81
|
[$._unannotated_type, $.primary_expression, $.inferred_parameters],
|
|
82
82
|
[$._unannotated_type, $.primary_expression],
|
|
83
|
-
[$._unannotated_type, $.primary_expression, $.scoped_type_identifier],
|
|
84
83
|
[$._unannotated_type, $.scoped_type_identifier],
|
|
85
84
|
[$._unannotated_type, $.generic_type],
|
|
86
85
|
[$.generic_type, $.primary_expression],
|
|
@@ -90,8 +89,70 @@ module.exports = grammar({
|
|
|
90
89
|
[$.inferred_parameters, $.primary_expression],
|
|
91
90
|
[$.argument_list, $.record_pattern_body],
|
|
92
91
|
[$.yield_statement, $._reserved_identifier],
|
|
92
|
+
[$.scoped_identifier, $.scoped_type_identifier],
|
|
93
|
+
[$.primary_expression, $.method_reference, $.scoped_identifier],
|
|
94
|
+
[$.primary_expression, $.method_reference, $.scoped_identifier, $._unannotated_type, $.scoped_type_identifier],
|
|
93
95
|
],
|
|
94
96
|
|
|
97
|
+
reserved: {
|
|
98
|
+
global: $ => [
|
|
99
|
+
'abstract',
|
|
100
|
+
'assert',
|
|
101
|
+
'boolean',
|
|
102
|
+
'break',
|
|
103
|
+
'byte',
|
|
104
|
+
'case',
|
|
105
|
+
'catch',
|
|
106
|
+
'char',
|
|
107
|
+
'class',
|
|
108
|
+
$._const,
|
|
109
|
+
'continue',
|
|
110
|
+
'default',
|
|
111
|
+
'do',
|
|
112
|
+
'double',
|
|
113
|
+
'else',
|
|
114
|
+
'enum',
|
|
115
|
+
'extends',
|
|
116
|
+
'final',
|
|
117
|
+
'finally',
|
|
118
|
+
'float',
|
|
119
|
+
'for',
|
|
120
|
+
$._goto,
|
|
121
|
+
'if',
|
|
122
|
+
'implements',
|
|
123
|
+
'import',
|
|
124
|
+
'instanceof',
|
|
125
|
+
'int',
|
|
126
|
+
'interface',
|
|
127
|
+
'long',
|
|
128
|
+
'native',
|
|
129
|
+
'new',
|
|
130
|
+
'package',
|
|
131
|
+
'private',
|
|
132
|
+
'protected',
|
|
133
|
+
'public',
|
|
134
|
+
'return',
|
|
135
|
+
'short',
|
|
136
|
+
'static',
|
|
137
|
+
'strictfp',
|
|
138
|
+
$.super,
|
|
139
|
+
'switch',
|
|
140
|
+
'synchronized',
|
|
141
|
+
$.this,
|
|
142
|
+
'throw',
|
|
143
|
+
'throws',
|
|
144
|
+
'transient',
|
|
145
|
+
'try',
|
|
146
|
+
'void',
|
|
147
|
+
'volatile',
|
|
148
|
+
'while',
|
|
149
|
+
$.underscore_pattern,
|
|
150
|
+
$.true,
|
|
151
|
+
$.false,
|
|
152
|
+
$.null_literal,
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
|
|
95
156
|
word: $ => $.identifier,
|
|
96
157
|
|
|
97
158
|
rules: {
|
|
@@ -309,7 +370,7 @@ module.exports = grammar({
|
|
|
309
370
|
|
|
310
371
|
lambda_expression: $ => seq(
|
|
311
372
|
field('parameters', choice(
|
|
312
|
-
$.identifier, $.formal_parameters, $.inferred_parameters, $._reserved_identifier,
|
|
373
|
+
$.identifier, $.formal_parameters, $.inferred_parameters, $._reserved_identifier, $.underscore_pattern,
|
|
313
374
|
)),
|
|
314
375
|
'->',
|
|
315
376
|
field('body', choice($.expression, $.block)),
|
|
@@ -317,7 +378,7 @@ module.exports = grammar({
|
|
|
317
378
|
|
|
318
379
|
inferred_parameters: $ => seq(
|
|
319
380
|
'(',
|
|
320
|
-
commaSep1(choice($.identifier, $._reserved_identifier)),
|
|
381
|
+
commaSep1(choice($.identifier, $._reserved_identifier, $.underscore_pattern)),
|
|
321
382
|
')',
|
|
322
383
|
),
|
|
323
384
|
|
|
@@ -450,11 +511,19 @@ module.exports = grammar({
|
|
|
450
511
|
|
|
451
512
|
argument_list: $ => seq('(', commaSep($.expression), ')'),
|
|
452
513
|
|
|
453
|
-
method_reference: $ =>
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
514
|
+
method_reference: $ => choice(
|
|
515
|
+
seq(
|
|
516
|
+
choice($._type, $.primary_expression, $.super),
|
|
517
|
+
'::',
|
|
518
|
+
optional($.type_arguments),
|
|
519
|
+
choice('new', $.identifier),
|
|
520
|
+
),
|
|
521
|
+
seq(
|
|
522
|
+
$._name, '.', $.super,
|
|
523
|
+
'::',
|
|
524
|
+
optional($.type_arguments),
|
|
525
|
+
$.identifier,
|
|
526
|
+
),
|
|
458
527
|
),
|
|
459
528
|
|
|
460
529
|
type_arguments: $ => seq(
|
|
@@ -1279,6 +1348,9 @@ module.exports = grammar({
|
|
|
1279
1348
|
alias('yield', $.identifier),
|
|
1280
1349
|
),
|
|
1281
1350
|
|
|
1351
|
+
_const: _ => /const/,
|
|
1352
|
+
_goto: _ => /goto/,
|
|
1353
|
+
|
|
1282
1354
|
this: _ => 'this',
|
|
1283
1355
|
|
|
1284
1356
|
super: _ => 'super',
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -2249,6 +2249,10 @@
|
|
|
2249
2249
|
{
|
|
2250
2250
|
"type": "identifier",
|
|
2251
2251
|
"named": true
|
|
2252
|
+
},
|
|
2253
|
+
{
|
|
2254
|
+
"type": "underscore_pattern",
|
|
2255
|
+
"named": true
|
|
2252
2256
|
}
|
|
2253
2257
|
]
|
|
2254
2258
|
}
|
|
@@ -2459,6 +2463,10 @@
|
|
|
2459
2463
|
{
|
|
2460
2464
|
"type": "inferred_parameters",
|
|
2461
2465
|
"named": true
|
|
2466
|
+
},
|
|
2467
|
+
{
|
|
2468
|
+
"type": "underscore_pattern",
|
|
2469
|
+
"named": true
|
|
2462
2470
|
}
|
|
2463
2471
|
]
|
|
2464
2472
|
}
|
|
@@ -2684,6 +2692,10 @@
|
|
|
2684
2692
|
"type": "primary_expression",
|
|
2685
2693
|
"named": true
|
|
2686
2694
|
},
|
|
2695
|
+
{
|
|
2696
|
+
"type": "scoped_identifier",
|
|
2697
|
+
"named": true
|
|
2698
|
+
},
|
|
2687
2699
|
{
|
|
2688
2700
|
"type": "super",
|
|
2689
2701
|
"named": true
|
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|