File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed
Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -1107,7 +1107,8 @@ module.exports = grammar({
11071107 "value" ,
11081108 "actual" ,
11091109 "set" ,
1110- "get"
1110+ "get" ,
1111+ "enum"
11111112 // TODO: More soft keywords
11121113 ) ,
11131114
Original file line number Diff line number Diff line change @@ -148,6 +148,33 @@ when (this) {
148148 (jump_expression
149149 (null_literal))))))
150150
151+ ================================================================================
152+ Expressions with Soft Keywords
153+ ================================================================================
154+
155+ when {
156+ hasEnum() -> enum.loc.filename
157+ }
158+
159+ --------------------------------------------------------------------------------
160+
161+ (source_file
162+ (when_expression
163+ (when_entry
164+ (when_condition
165+ (call_expression
166+ (simple_identifier)
167+ (call_suffix
168+ (value_arguments))))
169+ (control_structure_body
170+ (navigation_expression
171+ (navigation_expression
172+ (simple_identifier)
173+ (navigation_suffix
174+ (simple_identifier)))
175+ (navigation_suffix
176+ (simple_identifier)))))))
177+
151178================================================================================
152179Value declaration with receiver type
153180================================================================================
@@ -375,6 +402,7 @@ fun main() { val temp = b.y; b.y = b.z; b.z = temp }
375402when (dir) {
376403 1 -> { val temp = b.y; b.y = b.z; b.z = temp }
377404}
405+
378406--------------------------------------------------------------------------------
379407
380408(source_file
You can’t perform that action at this time.
0 commit comments