@willbooster/tree-sitter-kotlin 1.7.3 → 1.7.4
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 +10 -3
- package/package.json +1 -1
- package/src/node-types.json +12 -1
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -61,7 +61,7 @@ module.exports = grammar({
|
|
|
61
61
|
|
|
62
62
|
[$.function_value_parameters, $.function_type_parameters],
|
|
63
63
|
[$.parenthesized_type, $.function_type_parameters],
|
|
64
|
-
[$.
|
|
64
|
+
[$._multi_variable_declaration, $.function_type_parameters],
|
|
65
65
|
|
|
66
66
|
[$.class_modifier, $._reserved_identifier],
|
|
67
67
|
[$.platform_modifier, $._reserved_identifier],
|
|
@@ -88,6 +88,7 @@ module.exports = grammar({
|
|
|
88
88
|
extras: ($) => [/\s/, $.line_comment, $.block_comment],
|
|
89
89
|
|
|
90
90
|
externals: ($) => [
|
|
91
|
+
$._destructuring_type_start,
|
|
91
92
|
$._semi,
|
|
92
93
|
$._class_member_semi,
|
|
93
94
|
// Unlike properties, these declarations can end before another member on the same line.
|
|
@@ -346,7 +347,9 @@ module.exports = grammar({
|
|
|
346
347
|
|
|
347
348
|
variable_declaration: ($) => prec(1, seq(repeat($.annotation), $._identifier, optional(seq(':', $.type)))),
|
|
348
349
|
|
|
349
|
-
multi_variable_declaration: ($) =>
|
|
350
|
+
multi_variable_declaration: ($) => $._multi_variable_declaration,
|
|
351
|
+
|
|
352
|
+
_multi_variable_declaration: ($) => seq('(', optionalCommaSep1($.variable_declaration), ')'),
|
|
350
353
|
|
|
351
354
|
property_delegate: ($) => seq('by', $.expression),
|
|
352
355
|
|
|
@@ -730,7 +733,11 @@ module.exports = grammar({
|
|
|
730
733
|
|
|
731
734
|
lambda_parameters: ($) => seq(commaSep1($._lambda_parameter), optional(',')),
|
|
732
735
|
|
|
733
|
-
_lambda_parameter: ($) =>
|
|
736
|
+
_lambda_parameter: ($) =>
|
|
737
|
+
choice($.variable_declaration, alias($._destructuring_lambda_parameter, $.multi_variable_declaration)),
|
|
738
|
+
|
|
739
|
+
_destructuring_lambda_parameter: ($) =>
|
|
740
|
+
seq($._multi_variable_declaration, optional(seq(alias($._destructuring_type_start, ':'), field('type', $.type)))),
|
|
734
741
|
|
|
735
742
|
anonymous_function: ($) =>
|
|
736
743
|
prec.right(
|
package/package.json
CHANGED
package/src/node-types.json
CHANGED
|
@@ -1667,7 +1667,18 @@
|
|
|
1667
1667
|
{
|
|
1668
1668
|
"type": "multi_variable_declaration",
|
|
1669
1669
|
"named": true,
|
|
1670
|
-
"fields": {
|
|
1670
|
+
"fields": {
|
|
1671
|
+
"type": {
|
|
1672
|
+
"multiple": false,
|
|
1673
|
+
"required": false,
|
|
1674
|
+
"types": [
|
|
1675
|
+
{
|
|
1676
|
+
"type": "type",
|
|
1677
|
+
"named": true
|
|
1678
|
+
}
|
|
1679
|
+
]
|
|
1680
|
+
}
|
|
1681
|
+
},
|
|
1671
1682
|
"children": {
|
|
1672
1683
|
"multiple": true,
|
|
1673
1684
|
"required": false,
|
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|