@willbooster/tree-sitter-java 9.0.0 → 9.0.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 +3 -3
- package/package.json +1 -1
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -14,6 +14,7 @@ const DIGITS = token(choice('0', seq(/[1-9]/, optional(seq(optional(/_+/), DECIM
|
|
|
14
14
|
const HEX_DIGITS = token(sep1(/[A-Fa-f0-9]+/, /_+/));
|
|
15
15
|
|
|
16
16
|
const PREC = {
|
|
17
|
+
LAMBDA: -1,
|
|
17
18
|
// https://introcs.cs.princeton.edu/java/11precedence/
|
|
18
19
|
COMMENT: 0,
|
|
19
20
|
ASSIGN: 1,
|
|
@@ -82,7 +83,6 @@ module.exports = grammar({
|
|
|
82
83
|
[$._unannotated_type, $.generic_type],
|
|
83
84
|
[$.generic_type, $.primary_expression],
|
|
84
85
|
[$.expression, $.statement],
|
|
85
|
-
[$.lambda_expression, $.primary_expression],
|
|
86
86
|
[$.inferred_parameters, $.primary_expression],
|
|
87
87
|
[$.argument_list, $.record_pattern_body],
|
|
88
88
|
[$.yield_statement, $._reserved_identifier],
|
|
@@ -404,13 +404,13 @@ module.exports = grammar({
|
|
|
404
404
|
),
|
|
405
405
|
)),
|
|
406
406
|
|
|
407
|
-
lambda_expression: $ => seq(
|
|
407
|
+
lambda_expression: $ => prec(PREC.LAMBDA, seq(
|
|
408
408
|
field('parameters', choice(
|
|
409
409
|
$.identifier, $.formal_parameters, $.inferred_parameters, $._reserved_identifier, $.underscore_pattern,
|
|
410
410
|
)),
|
|
411
411
|
'->',
|
|
412
412
|
field('body', choice($.expression, $.block)),
|
|
413
|
-
),
|
|
413
|
+
)),
|
|
414
414
|
|
|
415
415
|
inferred_parameters: $ => seq(
|
|
416
416
|
'(',
|
package/package.json
CHANGED
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|