aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/switch.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2023-11-02 12:27:27 +0800
committerLi Jin <dragon-fly@qq.com>2023-11-02 12:27:27 +0800
commit5ad0f4daa8171460dc71332669c365bb8e07dab0 (patch)
treeda57ecdabf5fa54c324c023ac22c53041aaff143 /spec/outputs/switch.lua
parent2263cca3687bb5c6b9c51f42d59d2249c18941a0 (diff)
downloadyuescript-0.20.4.tar.gz
yuescript-0.20.4.tar.bz2
yuescript-0.20.4.zip
fix table matching syntax in switch statement with list table.v0.20.4
Diffstat (limited to 'spec/outputs/switch.lua')
-rw-r--r--spec/outputs/switch.lua35
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/outputs/switch.lua b/spec/outputs/switch.lua
index 1ace1e3..bbdf794 100644
--- a/spec/outputs/switch.lua
+++ b/spec/outputs/switch.lua
@@ -398,4 +398,39 @@ do
398 end 398 end
399 end 399 end
400end 400end
401do
402 do
403 local _exp_0 = tb
404 local _type_0 = type(_exp_0)
405 local _tab_0 = "table" == _type_0 or "userdata" == _type_0
406 local _match_0 = false
407 if _tab_0 then
408 local item
409 do
410 local _obj_0 = _exp_0[1]
411 local _type_1 = type(_obj_0)
412 if "table" == _type_1 or "userdata" == _type_1 then
413 item = _obj_0[1]
414 end
415 end
416 if item ~= nil then
417 _match_0 = true
418 print(item)
419 end
420 end
421 if not _match_0 then
422 if _tab_0 then
423 local a = _exp_0[1]
424 local b = _exp_0[2]
425 if a == nil then
426 a = 1
427 end
428 if b == nil then
429 b = "abc"
430 end
431 print(a, b)
432 end
433 end
434 end
435end
401return nil 436return nil