From fb22ba11ac2c363941d8bf34f8b8a9181bd7c7dc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 25 Jan 2018 18:07:41 -0800 Subject: Fixed improperly handling locals of a block. --- nomsu.moon | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nomsu.moon') diff --git a/nomsu.moon b/nomsu.moon index 52ce1ea..294a86f 100755 --- a/nomsu.moon +++ b/nomsu.moon @@ -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) -- cgit v1.2.3