@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 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('try', $.block, choice(seq(repeat1($.catch_block), optional($.finally_block)), $.finally_block)),
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: ($) => seq('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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "1.7.5",
3
+ "version": "2.0.0",
4
4
  "description": "Kotlin grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "1.7.5",
16
+ "version": "2.0.0",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [