@willbooster/tree-sitter-kotlin 1.4.1 → 1.4.2
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 +6 -3
- package/grammar.js +3 -1
- package/package.json +1 -1
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -60,12 +60,15 @@ parser.setLanguage(await Language.load(kotlin));
|
|
|
60
60
|
|
|
61
61
|
The package also ships the node types in `src/node-types.json`.
|
|
62
62
|
|
|
63
|
-
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-kotlin)
|
|
63
|
+
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-kotlin) and on
|
|
64
|
+
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
65
|
+
fuzzed with (the grammar also loads in the upstream `tree-sitter` crate 0.27, whose error recovery never ends on some
|
|
66
|
+
malformed input):
|
|
64
67
|
|
|
65
68
|
```toml
|
|
66
69
|
[dependencies]
|
|
67
|
-
tree-sitter = "
|
|
68
|
-
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin", version = "1
|
|
70
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "1" }
|
|
71
|
+
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin", version = "1" }
|
|
69
72
|
```
|
|
70
73
|
|
|
71
74
|
```rust
|
package/grammar.js
CHANGED
|
@@ -94,6 +94,8 @@ module.exports = grammar({
|
|
|
94
94
|
'$',
|
|
95
95
|
// used to check if a modifier alone on its line belongs to a declaration on the next line
|
|
96
96
|
'val',
|
|
97
|
+
// never scanned: it tells the scanner where a primary constructor may start
|
|
98
|
+
$._primary_constructor_position,
|
|
97
99
|
],
|
|
98
100
|
|
|
99
101
|
inline: ($) => [$._statements, $._identifier, $._control_structure_body],
|
|
@@ -143,7 +145,7 @@ module.exports = grammar({
|
|
|
143
145
|
choice('class', seq(optional('fun'), 'interface')),
|
|
144
146
|
field('name', $.identifier),
|
|
145
147
|
optional($.type_parameters),
|
|
146
|
-
optional($.primary_constructor),
|
|
148
|
+
optional(seq(optional($._primary_constructor_position), $.primary_constructor)),
|
|
147
149
|
optional(seq(':', $.delegation_specifiers)),
|
|
148
150
|
optional($.type_constraints),
|
|
149
151
|
optional(choice($.class_body, $.enum_class_body))
|
package/package.json
CHANGED
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|