Skip to content
This repository was archived by the owner on Dec 20, 2024. It is now read-only.

Commit b583df6

Browse files
committed
Merge PR fwcd#21 (Fix when expression typo)
2 parents 70c6fd4 + e5600b6 commit b583df6

File tree

9 files changed

+582402
-580298
lines changed

9 files changed

+582402
-580298
lines changed

corpus/expressions.txt

+26
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,29 @@ sum(1, 2)
2525
(call_suffix (value_arguments
2626
(value_argument (integer_literal))
2727
(value_argument (integer_literal))))))
28+
29+
==================
30+
When expression
31+
==================
32+
33+
val x = 1
34+
val y = when(x){
35+
1 -> true
36+
2 -> false
37+
}
38+
39+
---
40+
41+
(source_file
42+
(property_declaration
43+
(variable_declaration (simple_identifier))
44+
(integer_literal))
45+
(property_declaration
46+
(variable_declaration (simple_identifier))
47+
(when_expression
48+
(when_subject (simple_identifier))
49+
(when_entry (when_condition (integer_literal))
50+
(control_structure_body (boolean_literal)))
51+
(when_entry (when_condition (integer_literal))
52+
(control_structure_body (boolean_literal))))))
53+

grammar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -772,7 +772,7 @@ module.exports = grammar({
772772
optional($._semi)
773773
),
774774

775-
when_condition: $ => seq(
775+
when_condition: $ => choice(
776776
$._expression,
777777
$.range_test,
778778
$.type_test

index.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
try {
2+
module.exports = require("./build/Release/tree_sitter_kotlin_binding");
3+
} catch (error) {
4+
try {
5+
module.exports = require("./build/Debug/tree_sitter_kotlin_binding");
6+
} catch (_) {
7+
throw error
8+
}
9+
}
10+
11+
try {
12+
module.exports.nodeTypeInfo = require("./src/node-types.json");
13+
} catch (_) {}

0 commit comments

Comments
 (0)