@willbooster/tree-sitter-kotlin 1.7.5 → 2.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/grammar.js +11 -2
- package/package.json +1 -1
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -136,6 +136,7 @@ module.exports = grammar({
|
|
|
136
136
|
$._unseparated_member_start,
|
|
137
137
|
$._infix_position,
|
|
138
138
|
$._companion_name_position,
|
|
139
|
+
$._try_continuation_position,
|
|
139
140
|
],
|
|
140
141
|
|
|
141
142
|
inline: ($) => [$._statements, $._identifier, $._control_structure_body],
|
|
@@ -820,11 +821,19 @@ module.exports = grammar({
|
|
|
820
821
|
type_test: ($) => seq(choice('is', alias($._not_is, '!is')), $.type),
|
|
821
822
|
|
|
822
823
|
try_expression: ($) =>
|
|
823
|
-
seq(
|
|
824
|
+
seq(
|
|
825
|
+
'try',
|
|
826
|
+
$.block,
|
|
827
|
+
choice(
|
|
828
|
+
seq(repeat1(seq($.catch_block, optional($._try_continuation_position))), optional($.finally_block)),
|
|
829
|
+
$.finally_block
|
|
830
|
+
)
|
|
831
|
+
),
|
|
824
832
|
|
|
825
833
|
catch_block: ($) => seq('catch', '(', repeat($.annotation), $.identifier, ':', $.type, optional(','), ')', $.block),
|
|
826
834
|
|
|
827
|
-
finally_block: ($) =>
|
|
835
|
+
finally_block: ($) =>
|
|
836
|
+
choice(prec(1, seq($._try_continuation_position, 'finally', $.block)), seq('finally', $.block)),
|
|
828
837
|
|
|
829
838
|
return_expression: ($) =>
|
|
830
839
|
prec.right(seq(choice('return', seq('return@', field('label', $.identifier))), optional($.expression))),
|
package/package.json
CHANGED
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|