@willbooster/tree-sitter-kotlin 1.2.0 → 1.3.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/README.md +3 -2
- package/grammar.js +9 -3
- package/package.json +1 -1
- package/src/node-types.json +10 -2
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# @willbooster/tree-sitter-kotlin
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@willbooster/tree-sitter-kotlin)
|
|
4
|
+
[](https://crates.io/crates/willbooster-tree-sitter-kotlin)
|
|
4
5
|
[](https://www.npmjs.com/package/@willbooster/tree-sitter-kotlin)
|
|
5
6
|
[](https://github.com/WillBooster/tree-sitter-kotlin/actions/workflows/test.yml)
|
|
6
7
|
[](https://github.com/WillBooster/tree-sitter-kotlin/actions/workflows/test-rust.yml)
|
|
@@ -30,12 +31,12 @@ const tree = parser.parse('fun main() = println("Hello")\n');
|
|
|
30
31
|
|
|
31
32
|
The package also ships the node types in `src/node-types.json`.
|
|
32
33
|
|
|
33
|
-
In Rust, depend on the
|
|
34
|
+
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-kotlin):
|
|
34
35
|
|
|
35
36
|
```toml
|
|
36
37
|
[dependencies]
|
|
37
38
|
tree-sitter = "0.27"
|
|
38
|
-
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin",
|
|
39
|
+
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin", version = "1.2" }
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
```rust
|
package/grammar.js
CHANGED
|
@@ -41,6 +41,10 @@ module.exports = grammar({
|
|
|
41
41
|
[$.annotated_expression, $.type_modifiers],
|
|
42
42
|
[$.annotated_expression, $.type_modifiers, $.when_subject],
|
|
43
43
|
[$.annotated_expression, $.type_modifiers, $.modifiers],
|
|
44
|
+
[$.variable_declaration, $._loop_prefix, $.modifiers, $.type_modifiers, $.annotated_expression],
|
|
45
|
+
[$._loop_prefix, $.annotated_expression],
|
|
46
|
+
[$._loop_prefix, $.modifiers, $.type_modifiers, $.annotated_expression],
|
|
47
|
+
[$._loop_prefix, $.labeled_expression],
|
|
44
48
|
[$.parameter_modifiers, $.type_modifiers],
|
|
45
49
|
[$.function_modifier, $.type_modifiers],
|
|
46
50
|
[$.function_modifier, $._reserved_identifier],
|
|
@@ -286,7 +290,7 @@ module.exports = grammar({
|
|
|
286
290
|
for_statement: ($) =>
|
|
287
291
|
prec.right(
|
|
288
292
|
seq(
|
|
289
|
-
optional($.
|
|
293
|
+
optional($._loop_prefix),
|
|
290
294
|
'for',
|
|
291
295
|
'(',
|
|
292
296
|
repeat($.annotation),
|
|
@@ -301,7 +305,7 @@ module.exports = grammar({
|
|
|
301
305
|
while_statement: ($) =>
|
|
302
306
|
prec.right(
|
|
303
307
|
seq(
|
|
304
|
-
optional($.
|
|
308
|
+
optional($._loop_prefix),
|
|
305
309
|
'while',
|
|
306
310
|
'(',
|
|
307
311
|
field('condition', $.expression),
|
|
@@ -313,7 +317,7 @@ module.exports = grammar({
|
|
|
313
317
|
do_while_statement: ($) =>
|
|
314
318
|
prec.right(
|
|
315
319
|
seq(
|
|
316
|
-
optional($.
|
|
320
|
+
optional($._loop_prefix),
|
|
317
321
|
'do',
|
|
318
322
|
optional(choice(field('body', choice($.block, $.statement)), ';')),
|
|
319
323
|
'while',
|
|
@@ -323,6 +327,8 @@ module.exports = grammar({
|
|
|
323
327
|
)
|
|
324
328
|
),
|
|
325
329
|
|
|
330
|
+
_loop_prefix: ($) => prec.dynamic(1, repeat1(choice($.annotation, $.label))),
|
|
331
|
+
|
|
326
332
|
class_body: ($) => seq('{', repeat(seq($.class_member_declaration, $._class_member_semi)), '}'),
|
|
327
333
|
|
|
328
334
|
class_member_declaration: ($) =>
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -958,9 +958,13 @@
|
|
|
958
958
|
}
|
|
959
959
|
},
|
|
960
960
|
"children": {
|
|
961
|
-
"multiple":
|
|
961
|
+
"multiple": true,
|
|
962
962
|
"required": false,
|
|
963
963
|
"types": [
|
|
964
|
+
{
|
|
965
|
+
"type": "annotation",
|
|
966
|
+
"named": true
|
|
967
|
+
},
|
|
964
968
|
{
|
|
965
969
|
"type": "label",
|
|
966
970
|
"named": true
|
|
@@ -2623,9 +2627,13 @@
|
|
|
2623
2627
|
}
|
|
2624
2628
|
},
|
|
2625
2629
|
"children": {
|
|
2626
|
-
"multiple":
|
|
2630
|
+
"multiple": true,
|
|
2627
2631
|
"required": false,
|
|
2628
2632
|
"types": [
|
|
2633
|
+
{
|
|
2634
|
+
"type": "annotation",
|
|
2635
|
+
"named": true
|
|
2636
|
+
},
|
|
2629
2637
|
{
|
|
2630
2638
|
"type": "label",
|
|
2631
2639
|
"named": true
|
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|