Fixed improperly handling locals of a block.
This commit is contained in:
parent
6668918b2e
commit
fb22ba11ac
@ -897,14 +897,15 @@ do
|
||||
local lua = self:tree_to_lua(arg)
|
||||
if #tree.value == 1 and lua.expr and not lua.statements then
|
||||
return {
|
||||
expr = lua.expr
|
||||
expr = lua.expr,
|
||||
locals = lua.locals
|
||||
}
|
||||
end
|
||||
if lua.locals then
|
||||
local _list_1 = lua.locals
|
||||
for _index_1 = 1, #_list_1 do
|
||||
local l = _list_1[_index_1]
|
||||
locals[l] = true
|
||||
table.insert(locals, l)
|
||||
end
|
||||
end
|
||||
if lua.statements then
|
||||
|
@ -642,9 +642,9 @@ class NomsuCompiler
|
||||
for arg in *tree.value
|
||||
lua = @tree_to_lua arg
|
||||
if #tree.value == 1 and lua.expr and not lua.statements
|
||||
return expr:lua.expr
|
||||
return {expr:lua.expr, locals:lua.locals}
|
||||
if lua.locals
|
||||
for l in *lua.locals do locals[l] = true
|
||||
for l in *lua.locals do table.insert(locals, l)
|
||||
if lua.statements then insert lua_bits, lua.statements
|
||||
elseif lua.expr then insert lua_bits, "#{lua.expr};"
|
||||
utils.deduplicate(locals)
|
||||
|
Loading…
Reference in New Issue
Block a user