@willbooster/tree-sitter-kotlin 1.5.3 → 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
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "1.5.3",
3
+ "version": "1.5.4",
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.5.3",
16
+ "version": "1.5.4",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [