@willbooster/tree-sitter-kotlin 1.7.2 → 1.7.3
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 +10 -8
- package/package.json +1 -1
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/grammar.js
CHANGED
|
@@ -14,8 +14,9 @@ const PREC = {
|
|
|
14
14
|
ADD: 10,
|
|
15
15
|
MULTIPLY: 11,
|
|
16
16
|
AS: 12,
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
PREFIX: 13,
|
|
18
|
+
CALL: 14,
|
|
19
|
+
POSTFIX: 14,
|
|
19
20
|
};
|
|
20
21
|
|
|
21
22
|
// oxlint-disable-next-line unicorn/prefer-module -- This package is CommonJS, so tree-sitter loads grammar.js as CommonJS.
|
|
@@ -27,6 +28,7 @@ module.exports = grammar({
|
|
|
27
28
|
[$.class_body, $.enum_class_body],
|
|
28
29
|
|
|
29
30
|
[$.binary_expression, $.call_expression],
|
|
31
|
+
[$.unary_expression, $.binary_expression, $.call_expression],
|
|
30
32
|
[$.binary_expression, $.in_expression, $.call_expression],
|
|
31
33
|
[$.binary_expression, $.infix_expression, $.call_expression],
|
|
32
34
|
[$.binary_expression, $.range_expression, $.call_expression],
|
|
@@ -637,12 +639,12 @@ module.exports = grammar({
|
|
|
637
639
|
),
|
|
638
640
|
|
|
639
641
|
unary_expression: ($) =>
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
seq(field('operator', choice('++', '--', '+', '-', '!')), field('argument', $.expression))
|
|
644
|
-
|
|
645
|
-
)
|
|
642
|
+
choice(
|
|
643
|
+
prec.right(
|
|
644
|
+
PREC.PREFIX,
|
|
645
|
+
seq(field('operator', choice('++', '--', '+', '-', '!')), field('argument', $.expression))
|
|
646
|
+
),
|
|
647
|
+
prec.left(PREC.POSTFIX, seq(field('argument', $.expression), field('operator', choice('++', '--', '!!'))))
|
|
646
648
|
),
|
|
647
649
|
|
|
648
650
|
annotated_expression: ($) => seq($.annotation, $.expression),
|
package/package.json
CHANGED
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|