@willbooster/tree-sitter-java 6.0.2 → 7.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 +10 -7
- package/grammar.js +5 -4
- package/package.json +1 -1
- package/src/node-types.json +14 -0
- package/tree-sitter-java.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -12,12 +12,15 @@ Java grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), fork
|
|
|
12
12
|
[tree-sitter/tree-sitter-java](https://github.com/tree-sitter/tree-sitter-java). We are grateful
|
|
13
13
|
to its authors and contributors. This is not an official release of that project.
|
|
14
14
|
|
|
15
|
-
This fork is based on tree-sitter-java 0.23.5 and accepts `final` modifiers on switch
|
|
16
|
-
and typed record-pattern components, plus qualified names in record patterns. Unnamed
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
This fork is based on tree-sitter-java 0.23.5 and accepts annotation and `final` modifiers on switch and
|
|
16
|
+
`instanceof` type patterns and typed record-pattern components, plus qualified names in record patterns. Unnamed
|
|
17
|
+
pattern variables use `underscore_pattern` nodes. Binding annotations are direct children of `type_pattern`,
|
|
18
|
+
`instanceof_expression`, or `record_pattern_component`; an `instanceof` type test without a binding keeps its
|
|
19
|
+
annotations inside the `right` field's `annotated_type` node.
|
|
20
|
+
|
|
21
|
+
The parser ships as compact tables under the [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter)
|
|
22
|
+
fork's ABI (`0x57420007`). This package is tested with runtime 9.0.0. Runtimes with a different ABI, including
|
|
23
|
+
upstream's tree-sitter, reject the parser.
|
|
21
24
|
|
|
22
25
|
## Usage
|
|
23
26
|
|
|
@@ -81,7 +84,7 @@ fuzzed with:
|
|
|
81
84
|
```toml
|
|
82
85
|
[dependencies]
|
|
83
86
|
tree-sitter = { package = "willbooster-tree-sitter", version = "9.0.0" }
|
|
84
|
-
tree-sitter-java = { package = "willbooster-tree-sitter-java", version = "
|
|
87
|
+
tree-sitter-java = { package = "willbooster-tree-sitter-java", version = "7" }
|
|
85
88
|
```
|
|
86
89
|
|
|
87
90
|
```rust
|
package/grammar.js
CHANGED
|
@@ -73,7 +73,7 @@ module.exports = grammar({
|
|
|
73
73
|
[$.array_type, $._unannotated_type],
|
|
74
74
|
[$.array_type, $.primary_expression],
|
|
75
75
|
[$.modifiers, $.annotated_type, $.receiver_parameter],
|
|
76
|
-
[$.
|
|
76
|
+
[$.instanceof_expression, $.annotated_type],
|
|
77
77
|
[$.modifiers, $.annotated_type, $.module_declaration, $.package_declaration],
|
|
78
78
|
[$._unannotated_type, $.primary_expression, $.inferred_parameters],
|
|
79
79
|
[$._unannotated_type, $.primary_expression],
|
|
@@ -384,12 +384,13 @@ module.exports = grammar({
|
|
|
384
384
|
instanceof_expression: $ => prec(PREC.REL, seq(
|
|
385
385
|
field('left', $.expression),
|
|
386
386
|
'instanceof',
|
|
387
|
-
optional('final'),
|
|
388
387
|
choice(
|
|
389
388
|
seq(
|
|
390
|
-
|
|
391
|
-
|
|
389
|
+
repeat(choice($._annotation, 'final')),
|
|
390
|
+
field('right', $._unannotated_type),
|
|
391
|
+
field('name', choice($.identifier, $._reserved_identifier, $.underscore_pattern)),
|
|
392
392
|
),
|
|
393
|
+
field('right', $._type),
|
|
393
394
|
field('pattern', $.record_pattern),
|
|
394
395
|
),
|
|
395
396
|
)),
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -2305,6 +2305,20 @@
|
|
|
2305
2305
|
}
|
|
2306
2306
|
]
|
|
2307
2307
|
}
|
|
2308
|
+
},
|
|
2309
|
+
"children": {
|
|
2310
|
+
"multiple": true,
|
|
2311
|
+
"required": false,
|
|
2312
|
+
"types": [
|
|
2313
|
+
{
|
|
2314
|
+
"type": "annotation",
|
|
2315
|
+
"named": true
|
|
2316
|
+
},
|
|
2317
|
+
{
|
|
2318
|
+
"type": "marker_annotation",
|
|
2319
|
+
"named": true
|
|
2320
|
+
}
|
|
2321
|
+
]
|
|
2308
2322
|
}
|
|
2309
2323
|
},
|
|
2310
2324
|
{
|
package/tree-sitter-java.wasm
CHANGED
|
Binary file
|