From 90c56d31352a0eeccd382ef5921baf3af4971040 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 26 Jan 2018 20:20:12 -0800 Subject: Added a ton of tests for virtually all the functionality. Helped me find and fix a lot of latent problems. --- nomsu.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nomsu.lua') diff --git a/nomsu.lua b/nomsu.lua index afa4cb0..d2acc1a 100644 --- a/nomsu.lua +++ b/nomsu.lua @@ -1311,6 +1311,9 @@ do self:define_compile_action("immediately %block", get_line_no(), function(_block) local lua = nomsu:tree_to_lua(_block) local lua_code = lua.statements or (lua.expr .. ";") + if lua.locals and #lua.locals > 0 then + lua_code = "local " .. tostring(concat(lua.locals, ", ")) .. ";\n" .. tostring(lua_code) + end nomsu:run_lua(lua_code) return { statements = "if IMMEDIATE then\n" .. tostring(lua_code) .. "\nend", -- cgit v1.2.3