@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 +18 -17
- package/package.json +1 -1
- package/src/node-types.json +0 -4
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
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.
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
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
package/src/node-types.json
CHANGED
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|