kill some more anon funcs for while,for,foreach

This commit is contained in:
leaf corcoran 2013-06-30 21:20:01 -07:00
parent 82f73842d8
commit 642932c1d5
4 changed files with 42 additions and 35 deletions

View File

@ -369,7 +369,7 @@ Statement = Transformer({
block_body
}
})
elseif "comprehension" == _exp_0 or "tblcomprehension" == _exp_0 then
elseif "comprehension" == _exp_0 or "tblcomprehension" == _exp_0 or "foreach" == _exp_0 or "for" == _exp_0 or "while" == _exp_0 then
return build.assign_one(first_name, Value.transformers[first_value[1]](self, first_value))
end
end

View File

@ -190,7 +190,7 @@ Statement = Transformer {
{"do", block_body}
}
when "comprehension", "tblcomprehension"
when "comprehension", "tblcomprehension", "foreach", "for", "while"
return build.assign_one first_name,
Value.transformers[first_value[1]] @, first_value

View File

@ -30,7 +30,8 @@ do
end
k = _accum_0
end
local j = (function()
local j
do
local _accum_0 = { }
local _len_0 = 1
for i = 1, 10 do
@ -39,8 +40,8 @@ local j = (function()
end
_len_0 = _len_0 + 1
end
return _accum_0
end)()
j = _accum_0
end
local m
m = function(...)
return (function(...)
@ -59,7 +60,8 @@ m = function(...)
return _accum_0
end)(...)
end
local x = (function(...)
local x
do
local _accum_0 = { }
local _len_0 = 1
local _list_0 = {
@ -70,8 +72,8 @@ local x = (function(...)
_accum_0[_len_0] = i
_len_0 = _len_0 + 1
end
return _accum_0
end)(...)
x = _accum_0
end
local y
do
local _accum_0 = { }
@ -98,16 +100,18 @@ do
end
z = _accum_0
end
local a = (function(...)
local a
do
local _accum_0 = { }
local _len_0 = 1
for i = 1, 10 do
_accum_0[_len_0] = ...
_len_0 = _len_0 + 1
end
return _accum_0
end)(...)
local b = (function()
a = _accum_0
end
local b
do
local _accum_0 = { }
local _len_0 = 1
for i = 1, 10 do
@ -116,5 +120,5 @@ local b = (function()
end
_len_0 = _len_0 + 1
end
return _accum_0
end)()
b = _accum_0
end

View File

@ -48,7 +48,7 @@ local hello = {
4,
5
}
x = (function()
do
local _accum_0 = { }
local _len_0 = 1
for _index_0 = 1, #hello do
@ -58,25 +58,27 @@ x = (function()
end
_len_0 = _len_0 + 1
end
return _accum_0
end)()
x = _accum_0
end
x = function()
for _index_0 = 1, #hello do
x = hello[_index_0]
local _ = y
end
end
local t = (function()
local t
do
local _accum_0 = { }
local _len_0 = 1
for i = 10, 20 do
_accum_0[_len_0] = i * 2
_len_0 = _len_0 + 1
end
return _accum_0
end)()
t = _accum_0
end
local hmm = 0
local y = (function()
local y
do
local _accum_0 = { }
local _len_0 = 1
for j = 3, 30, 8 do
@ -85,8 +87,8 @@ local y = (function()
_accum_0[_len_0] = _value_0
_len_0 = _len_0 + 1
end
return _accum_0
end)()
y = _accum_0
end
local _
_ = function()
for k = 10, 40 do
@ -116,7 +118,7 @@ while also do
_ = "okay"
end
local i = 0
x = (function()
do
local _accum_0 = { }
local _len_0 = 1
while i < 10 do
@ -125,9 +127,9 @@ x = (function()
_accum_0[_len_0] = _value_0
_len_0 = _len_0 + 1
end
return _accum_0
end)()
x = (function()
x = _accum_0
end
do
local _accum_0 = { }
local _len_0 = 1
local _list_1 = 3
@ -138,9 +140,9 @@ x = (function()
_accum_0[_len_0] = _value_0
_len_0 = _len_0 + 1
end
return _accum_0
end)()
x = (function()
x = _accum_0
end
do
local _accum_0 = { }
local _len_0 = 1
for x = 1, 2 do
@ -149,8 +151,8 @@ x = (function()
_accum_0[_len_0] = _value_0
_len_0 = _len_0 + 1
end
return _accum_0
end)()
x = _accum_0
end
while true do
local _continue_0 = false
repeat
@ -183,7 +185,8 @@ for x = 1, 10 do
break
end
end
local list = (function()
local list
do
local _accum_0 = { }
local _len_0 = 1
for x = 1, 10 do
@ -202,8 +205,8 @@ local list = (function()
break
end
end
return _accum_0
end)()
list = _accum_0
end
local _list_1 = {
1,
2,