summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-12-17 17:33:38 +0800
committerLi Jin <dragon-fly@qq.com>2021-12-17 17:33:38 +0800
commit05ef9bb1ffefbc717f3fb4738f3683b3cb09a82e (patch)
tree163878ad9edab0408ad5fc46b1b9f02b473eb0ac /spec
parent2138d176edfe1f8ba3ecee211f15825e97f0570a (diff)
downloadyuescript-0.9.5.tar.gz
yuescript-0.9.5.tar.bz2
yuescript-0.9.5.zip
eliminate some ambiguous syntax.v0.9.5
Diffstat (limited to 'spec')
-rw-r--r--spec/inputs/cond.yue16
-rw-r--r--spec/outputs/cond.lua30
2 files changed, 46 insertions, 0 deletions
diff --git a/spec/inputs/cond.yue b/spec/inputs/cond.yue
index 3dee99b..d33eec4 100644
--- a/spec/inputs/cond.yue
+++ b/spec/inputs/cond.yue
@@ -182,7 +182,23 @@ m = if 1
182 182
183else 6 183else 6
184 184
185do
186 a
187 :b
188 return if a
189 :b
190 else if c
191 d: e
192 else
193 f: 123
185 194
195do
196 c
197 d: e
198 if a
199 :b = tb
200 elseif c
201 d: e = tb
186 202
187nil 203nil
188 204
diff --git a/spec/outputs/cond.lua b/spec/outputs/cond.lua
index 5efa237..8f69e97 100644
--- a/spec/outputs/cond.lua
+++ b/spec/outputs/cond.lua
@@ -269,4 +269,34 @@ if 1 then
269else 269else
270 m = 6 270 m = 6
271end 271end
272do
273 a({
274 b = b
275 })
276 if a then
277 return {
278 b = b
279 }
280 else
281 if c then
282 return {
283 d = e
284 }
285 else
286 return {
287 f = 123
288 }
289 end
290 end
291end
292do
293 c({
294 d = e
295 })
296 if a then
297 b = tb.b
298 elseif c then
299 local e = tb.d
300 end
301end
272return nil 302return nil