@willbooster/tree-sitter-java 8.0.1 → 8.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 +17 -10
- package/package.json +1 -1
- package/src/node-types.json +4 -0
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -337,7 +337,13 @@ module.exports = grammar({
|
|
|
337
337
|
'(',
|
|
338
338
|
sep1(field('type', $._type), '&'),
|
|
339
339
|
')',
|
|
340
|
-
field('value', choice(
|
|
340
|
+
field('value', choice(
|
|
341
|
+
$.primary_expression,
|
|
342
|
+
alias($._unary_complement_expression, $.unary_expression),
|
|
343
|
+
$.cast_expression,
|
|
344
|
+
$.switch_expression,
|
|
345
|
+
$.lambda_expression,
|
|
346
|
+
)),
|
|
341
347
|
),
|
|
342
348
|
)),
|
|
343
349
|
|
|
@@ -347,6 +353,7 @@ module.exports = grammar({
|
|
|
347
353
|
$._reserved_identifier,
|
|
348
354
|
$.field_access,
|
|
349
355
|
$.array_access,
|
|
356
|
+
$.parenthesized_expression,
|
|
350
357
|
)),
|
|
351
358
|
field('operator', choice('=', '+=', '-=', '*=', '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=')),
|
|
352
359
|
field('right', $.expression),
|
|
@@ -418,17 +425,17 @@ module.exports = grammar({
|
|
|
418
425
|
field('alternative', $.expression),
|
|
419
426
|
)),
|
|
420
427
|
|
|
421
|
-
unary_expression: $ => choice(
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
['~', PREC.UNARY],
|
|
426
|
-
].map(([operator, precedence]) =>
|
|
427
|
-
prec.left(precedence, seq(
|
|
428
|
-
// @ts-ignore
|
|
429
|
-
field('operator', operator),
|
|
428
|
+
unary_expression: $ => choice(
|
|
429
|
+
$._unary_complement_expression,
|
|
430
|
+
prec.left(PREC.UNARY, seq(
|
|
431
|
+
field('operator', choice('+', '-')),
|
|
430
432
|
field('operand', $.expression),
|
|
431
433
|
)),
|
|
434
|
+
),
|
|
435
|
+
|
|
436
|
+
_unary_complement_expression: $ => prec.left(PREC.UNARY, seq(
|
|
437
|
+
field('operator', choice('~', '!')),
|
|
438
|
+
field('operand', $.expression),
|
|
432
439
|
)),
|
|
433
440
|
|
|
434
441
|
update_expression: $ => prec.left(PREC.UNARY, choice(
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|