@willbooster/tree-sitter-kotlin 1.5.2 → 1.5.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 CHANGED
@@ -370,19 +370,24 @@ module.exports = grammar({
370
370
  statement: ($) =>
371
371
  choice($.declaration, $.assignment, $.for_statement, $.while_statement, $.do_while_statement, $.expression),
372
372
 
373
+ // An annotation before a declaration may also read as an annotated expression statement (`@A (b)`), and both
374
+ // readings parse, so the one in which it modifies the declaration takes dynamic precedence, as in Kotlin.
373
375
  modifiers: ($) =>
374
- prec.right(
375
- repeat1(
376
- choice(
377
- $.annotation,
378
- $.class_modifier,
379
- $.member_modifier,
380
- $.function_modifier,
381
- $.property_modifier,
382
- $.visibility_modifier,
383
- $.inheritance_modifier,
384
- $.parameter_modifier,
385
- $.platform_modifier
376
+ prec.dynamic(
377
+ 1,
378
+ prec.right(
379
+ repeat1(
380
+ choice(
381
+ $.annotation,
382
+ $.class_modifier,
383
+ $.member_modifier,
384
+ $.function_modifier,
385
+ $.property_modifier,
386
+ $.visibility_modifier,
387
+ $.inheritance_modifier,
388
+ $.parameter_modifier,
389
+ $.platform_modifier
390
+ )
386
391
  )
387
392
  )
388
393
  ),
@@ -720,11 +725,7 @@ module.exports = grammar({
720
725
 
721
726
  multiline_string_literal: ($) =>
722
727
  choice(
723
- seq(
724
- '"""',
725
- repeat(choice(alias($._multiline_string_content, $.string_content), $.interpolation)),
726
- choice('"""', '""""')
727
- ),
728
+ seq('"""', repeat(choice(alias($._multiline_string_content, $.string_content), $.interpolation)), '"""'),
728
729
  seq(
729
730
  $._multi_dollar_multiline_string_start,
730
731
  repeat(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "Kotlin grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -2745,10 +2745,6 @@
2745
2745
  "type": "\"\"\"",
2746
2746
  "named": false
2747
2747
  },
2748
- {
2749
- "type": "\"\"\"\"",
2750
- "named": false
2751
- },
2752
2748
  {
2753
2749
  "type": "$",
2754
2750
  "named": false
Binary file
package/tree-sitter.json CHANGED
@@ -13,7 +13,7 @@
13
13
  }
14
14
  ],
15
15
  "metadata": {
16
- "version": "1.5.2",
16
+ "version": "1.5.4",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [