diff options
author | Li Jin <dragon-fly@qq.com> | 2021-10-31 17:29:45 +0800 |
---|---|---|
committer | Li Jin <dragon-fly@qq.com> | 2021-10-31 17:29:45 +0800 |
commit | aed806476fe50899c0f01750175531ac41267b9d (patch) | |
tree | c46f212a2987a9088b03e2c0225f18cd9a5d4265 /spec/outputs/export.lua | |
parent | 60a979e224f26117f5be82bfca757a2483cef0fd (diff) | |
download | yuescript-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.lua | 32 |
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 |
66 | end | 66 | end |
67 | _module_0["y"] = y | 67 | _module_0["y"] = y |
68 | local _exp_0 = h | 68 | do |
69 | if 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 |
71 | elseif 200 == _exp_0 then | 71 | _module_0[#_module_0 + 1] = 200 |
72 | _module_0[#_module_0 + 1] = 300 | 72 | elseif 200 == _exp_0 then |
73 | else | 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 | ||
75 | end | 77 | end |
76 | local Constant | 78 | local Constant |
77 | local _exp_1 = value | 79 | do |
78 | if "good" == _exp_1 then | 80 | local _exp_0 = value |
79 | Constant = 1 | 81 | if "good" == _exp_0 then |
80 | elseif "better" == _exp_1 then | 82 | Constant = 1 |
81 | Constant = 2 | 83 | elseif "better" == _exp_0 then |
82 | elseif "best" == _exp_1 then | 84 | Constant = 2 |
83 | Constant = 3 | 85 | elseif "best" == _exp_0 then |
86 | Constant = 3 | ||
87 | end | ||
84 | end | 88 | end |
85 | _module_0["Constant"] = Constant | 89 | _module_0["Constant"] = Constant |
86 | local item = func(123) | 90 | local item = func(123) |