@willbooster/tree-sitter-kotlin 2.0.0 → 3.0.0

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
@@ -137,6 +137,7 @@ module.exports = grammar({
137
137
  $._infix_position,
138
138
  $._companion_name_position,
139
139
  $._try_continuation_position,
140
+ $._infix_get_identifier,
140
141
  ],
141
142
 
142
143
  inline: ($) => [$._statements, $._identifier, $._control_structure_body],
@@ -709,7 +710,15 @@ module.exports = grammar({
709
710
  range_expression: ($) => prec.left(PREC.RANGE, seq($.expression, choice('..', '..<'), $.expression)),
710
711
 
711
712
  infix_expression: ($) =>
712
- prec.left(PREC.INFIX, seq($.expression, optional($._infix_position), $.identifier, $.expression)),
713
+ prec.left(
714
+ PREC.INFIX,
715
+ seq(
716
+ $.expression,
717
+ optional($._infix_position),
718
+ choice($.identifier, alias($._infix_get_identifier, $.identifier)),
719
+ $.expression
720
+ )
721
+ ),
713
722
 
714
723
  // Right-associative so that a trailing lambda after arguments belongs to the same call (`f(x) { … }`), as in
715
724
  // Kotlin, instead of calling the result of `f(x)`.
@@ -964,7 +973,7 @@ module.exports = grammar({
964
973
 
965
974
  label: () => token(/[a-zA-Z_][a-zA-Z_0-9]*@/),
966
975
 
967
- _identifier: ($) => choice($.identifier, $._reserved_identifier),
976
+ _identifier: ($) => choice($.identifier, $._reserved_identifier, alias($._infix_get_identifier, $.identifier)),
968
977
 
969
978
  identifier: () => token(choice(/[\p{L}_][\p{L}_\p{Nd}]*/u, /`[^\r\n`]+`/)),
970
979
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-kotlin",
3
- "version": "2.0.0",
3
+ "version": "3.0.0",
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": "2.0.0",
16
+ "version": "3.0.0",
17
17
  "license": "MIT",
18
18
  "description": "Kotlin grammar for tree-sitter",
19
19
  "authors": [