@willbooster/tree-sitter-kotlin 5.0.2 → 5.0.3
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 +13 -4
- package/package.json +11 -11
- package/src/node-types.json +14 -2
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -42,6 +42,12 @@ module.exports = grammar({
|
|
|
42
42
|
[$.user_type],
|
|
43
43
|
[$._simple_user_type, $.primary_expression],
|
|
44
44
|
[$.type, $._receiver_type],
|
|
45
|
+
[$._receiver_type, $._reserved_identifier],
|
|
46
|
+
[$.type, $._reserved_identifier],
|
|
47
|
+
[$.nullable_type, $._reserved_identifier],
|
|
48
|
+
[$.type, $.nullable_type, $._reserved_identifier],
|
|
49
|
+
[$.type, $.nullable_type],
|
|
50
|
+
[$.type, $._receiver_type, $._reserved_identifier],
|
|
45
51
|
|
|
46
52
|
[$.modifiers, $.annotated_lambda],
|
|
47
53
|
[$.modifiers, $.annotated_expression],
|
|
@@ -146,7 +152,7 @@ module.exports = grammar({
|
|
|
146
152
|
sym('_infix_get_identifier'),
|
|
147
153
|
],
|
|
148
154
|
|
|
149
|
-
inline: ($) => [$._statements, $._identifier, $._control_structure_body],
|
|
155
|
+
inline: ($) => [$._statements, $._identifier, $._control_structure_body, $._non_function_type],
|
|
150
156
|
|
|
151
157
|
precedences: ($) => [
|
|
152
158
|
[$.block, $.lambda_literal],
|
|
@@ -550,14 +556,16 @@ module.exports = grammar({
|
|
|
550
556
|
|
|
551
557
|
_annotation_arguments: ($) => valueArguments($, alias(token.immediate('('), '(')),
|
|
552
558
|
|
|
553
|
-
type: ($) =>
|
|
554
|
-
|
|
559
|
+
type: ($) => choice($._non_function_type, $.function_type),
|
|
560
|
+
|
|
561
|
+
_non_function_type: ($) =>
|
|
562
|
+
choice($.user_type, $.nullable_type, $.non_nullable_type, $.parenthesized_type, 'dynamic'),
|
|
555
563
|
|
|
556
564
|
user_type: ($) => seq(optional($.type_modifiers), sep1($._simple_user_type, '.')),
|
|
557
565
|
|
|
558
566
|
_simple_user_type: ($) => prec.right(seq($._identifier, optional($.type_arguments))),
|
|
559
567
|
|
|
560
|
-
nullable_type: ($) => seq(optional($.type_modifiers), $.
|
|
568
|
+
nullable_type: ($) => seq(optional($.type_modifiers), $._non_function_type, '?'),
|
|
561
569
|
|
|
562
570
|
non_nullable_type: ($) =>
|
|
563
571
|
prec.right(seq(optional($.type_modifiers), $.type, '&', optional($.type_modifiers), $.type)),
|
|
@@ -1016,6 +1024,7 @@ module.exports = grammar({
|
|
|
1016
1024
|
'const',
|
|
1017
1025
|
'constructor',
|
|
1018
1026
|
'data',
|
|
1027
|
+
'dynamic',
|
|
1019
1028
|
'enum',
|
|
1020
1029
|
'expect',
|
|
1021
1030
|
'external',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-kotlin",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.3",
|
|
4
4
|
"description": "Kotlin grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -45,20 +45,20 @@
|
|
|
45
45
|
"@vitest/browser-playwright": "5.0.3",
|
|
46
46
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
47
47
|
"@willbooster/oxlint-config": "1.4.8",
|
|
48
|
-
"@willbooster/wb": "22.
|
|
49
|
-
"@willbooster/web-tree-sitter": "2.0.
|
|
50
|
-
"conventional-changelog-conventionalcommits": "10.4.
|
|
51
|
-
"lefthook": "2.1
|
|
52
|
-
"oxfmt": "0.
|
|
53
|
-
"oxlint": "1.
|
|
54
|
-
"oxlint-tsgolint": "7.0.
|
|
55
|
-
"playwright": "1.
|
|
48
|
+
"@willbooster/wb": "22.26.1",
|
|
49
|
+
"@willbooster/web-tree-sitter": "2.0.24",
|
|
50
|
+
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
51
|
+
"lefthook": "2.2.1",
|
|
52
|
+
"oxfmt": "0.72.0",
|
|
53
|
+
"oxlint": "1.87.0",
|
|
54
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
55
|
+
"playwright": "1.64.0",
|
|
56
56
|
"semantic-release": "25.0.9",
|
|
57
57
|
"sort-package-json": "4.0.0",
|
|
58
58
|
"typescript": "7.0.2",
|
|
59
|
-
"vite": "8.3.
|
|
59
|
+
"vite": "8.3.4",
|
|
60
60
|
"vitest": "5.0.3",
|
|
61
|
-
"wrangler": "4.
|
|
61
|
+
"wrangler": "4.149.0"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"@willbooster/web-tree-sitter": "^2.0.0"
|
package/src/node-types.json
CHANGED
|
@@ -1753,15 +1753,27 @@
|
|
|
1753
1753
|
"fields": {},
|
|
1754
1754
|
"children": {
|
|
1755
1755
|
"multiple": true,
|
|
1756
|
-
"required":
|
|
1756
|
+
"required": false,
|
|
1757
1757
|
"types": [
|
|
1758
1758
|
{
|
|
1759
|
-
"type": "
|
|
1759
|
+
"type": "non_nullable_type",
|
|
1760
|
+
"named": true
|
|
1761
|
+
},
|
|
1762
|
+
{
|
|
1763
|
+
"type": "nullable_type",
|
|
1764
|
+
"named": true
|
|
1765
|
+
},
|
|
1766
|
+
{
|
|
1767
|
+
"type": "parenthesized_type",
|
|
1760
1768
|
"named": true
|
|
1761
1769
|
},
|
|
1762
1770
|
{
|
|
1763
1771
|
"type": "type_modifiers",
|
|
1764
1772
|
"named": true
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
"type": "user_type",
|
|
1776
|
+
"named": true
|
|
1765
1777
|
}
|
|
1766
1778
|
]
|
|
1767
1779
|
}
|
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|