@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 +11 -2
- package/package.json +1 -1
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
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(
|
|
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
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|