@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 CHANGED
@@ -14,8 +14,9 @@ const PREC = {
14
14
  ADD: 10,
15
15
  MULTIPLY: 11,
16
16
  AS: 12,
17
- CALL: 13,
18
- UNARY: 14,
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
- prec.left(
641
- PREC.UNARY,
642
- choice(
643
- seq(field('operator', choice('++', '--', '+', '-', '!')), field('argument', $.expression)),
644
- seq(field('argument', $.expression), field('operator', choice('++', '--', '!!')))
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "1.7.2",
3
+ "version": "1.7.3",
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.2",
16
+ "version": "1.7.3",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [