@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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-java",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
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": "9.0.0",
17
+ "version": "9.0.1",
18
18
  "license": "MIT",
19
19
  "description": "Java grammar for tree-sitter",
20
20
  "authors": [