aboutsummaryrefslogtreecommitdiff
path: root/spec/outputs/export.lua
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2021-10-31 17:29:45 +0800
committerLi Jin <dragon-fly@qq.com>2021-10-31 17:29:45 +0800
commitaed806476fe50899c0f01750175531ac41267b9d (patch)
treec46f212a2987a9088b03e2c0225f18cd9a5d4265 /spec/outputs/export.lua
parent60a979e224f26117f5be82bfca757a2483cef0fd (diff)
downloadyuescript-aed806476fe50899c0f01750175531ac41267b9d.tar.gz
yuescript-aed806476fe50899c0f01750175531ac41267b9d.tar.bz2
yuescript-aed806476fe50899c0f01750175531ac41267b9d.zip
partially fix issue #69, fix a few case the generated code leaks some temp variables.
Diffstat (limited to 'spec/outputs/export.lua')
-rw-r--r--spec/outputs/export.lua32
1 files changed, 18 insertions, 14 deletions
diff --git a/spec/outputs/export.lua b/spec/outputs/export.lua
index 02546ec..4d81cc0 100644
--- a/spec/outputs/export.lua
+++ b/spec/outputs/export.lua
@@ -65,22 +65,26 @@ y = function()
65 local k = 100 65 local k = 100
66end 66end
67_module_0["y"] = y 67_module_0["y"] = y
68local _exp_0 = h 68do
69if 100 == _exp_0 or 150 == _exp_0 then 69 local _exp_0 = h
70 _module_0[#_module_0 + 1] = 200 70 if 100 == _exp_0 or 150 == _exp_0 then
71elseif 200 == _exp_0 then 71 _module_0[#_module_0 + 1] = 200
72 _module_0[#_module_0 + 1] = 300 72 elseif 200 == _exp_0 then
73else 73 _module_0[#_module_0 + 1] = 300
74 _module_0[#_module_0 + 1] = 0 74 else
75 _module_0[#_module_0 + 1] = 0
76 end
75end 77end
76local Constant 78local Constant
77local _exp_1 = value 79do
78if "good" == _exp_1 then 80 local _exp_0 = value
79 Constant = 1 81 if "good" == _exp_0 then
80elseif "better" == _exp_1 then 82 Constant = 1
81 Constant = 2 83 elseif "better" == _exp_0 then
82elseif "best" == _exp_1 then 84 Constant = 2
83 Constant = 3 85 elseif "best" == _exp_0 then
86 Constant = 3
87 end
84end 88end
85_module_0["Constant"] = Constant 89_module_0["Constant"] = Constant
86local item = func(123) 90local item = func(123)