@willbooster/tree-sitter-java 8.0.3 → 9.0.0
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/README.md +2 -1
- package/grammar.js +13 -6
- package/package.json +1 -1
- package/src/node-types.json +1 -1
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -19,6 +19,7 @@ pattern variables use `underscore_pattern` nodes. Binding annotations are direct
|
|
|
19
19
|
annotations inside the `right` field's `annotated_type` node.
|
|
20
20
|
|
|
21
21
|
Annotation interface declarations expose separate `@` and `interface` tokens.
|
|
22
|
+
Postfix updates appear inside surrounding cast or unary nodes. An `update_expression` has a primary expression as its operand.
|
|
22
23
|
|
|
23
24
|
The parser ships as compact tables under the [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter)
|
|
24
25
|
fork's ABI (`0x57420007`). This package is tested with runtime 9.0.0. Runtimes with a different ABI, including
|
|
@@ -86,7 +87,7 @@ fuzzed with:
|
|
|
86
87
|
```toml
|
|
87
88
|
[dependencies]
|
|
88
89
|
tree-sitter = { package = "willbooster-tree-sitter", version = "9.0.0" }
|
|
89
|
-
tree-sitter-java = { package = "willbooster-tree-sitter-java", version = "
|
|
90
|
+
tree-sitter-java = { package = "willbooster-tree-sitter-java", version = "9" }
|
|
90
91
|
```
|
|
91
92
|
|
|
92
93
|
```rust
|
package/grammar.js
CHANGED
|
@@ -326,7 +326,7 @@ module.exports = grammar({
|
|
|
326
326
|
$.switch_expression,
|
|
327
327
|
),
|
|
328
328
|
|
|
329
|
-
cast_expression: $ => prec(PREC.CAST, choice(
|
|
329
|
+
cast_expression: $ => prec.right(PREC.CAST, choice(
|
|
330
330
|
seq(
|
|
331
331
|
'(',
|
|
332
332
|
field('type', $._type),
|
|
@@ -339,6 +339,7 @@ module.exports = grammar({
|
|
|
339
339
|
')',
|
|
340
340
|
field('value', choice(
|
|
341
341
|
$.primary_expression,
|
|
342
|
+
alias($._postfix_update_expression, $.update_expression),
|
|
342
343
|
alias($._unary_complement_expression, $.unary_expression),
|
|
343
344
|
$.cast_expression,
|
|
344
345
|
$.switch_expression,
|
|
@@ -438,11 +439,17 @@ module.exports = grammar({
|
|
|
438
439
|
field('operand', $.expression),
|
|
439
440
|
)),
|
|
440
441
|
|
|
441
|
-
update_expression: $ =>
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
442
|
+
update_expression: $ => choice(
|
|
443
|
+
$._postfix_update_expression,
|
|
444
|
+
prec.right(PREC.UNARY, choice(
|
|
445
|
+
seq('++', $.primary_expression),
|
|
446
|
+
seq('--', $.primary_expression),
|
|
447
|
+
)),
|
|
448
|
+
),
|
|
449
|
+
|
|
450
|
+
_postfix_update_expression: $ => prec.right(PREC.UNARY, choice(
|
|
451
|
+
seq($.primary_expression, '++'),
|
|
452
|
+
seq($.primary_expression, '--'),
|
|
446
453
|
)),
|
|
447
454
|
|
|
448
455
|
primary_expression: $ => choice(
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|