From b6d3cbd61cd08e39d20a569b7c5ece6bb25897dd Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 1 Jan 2019 15:05:58 -0800 Subject: Misc changes, including text indented interpolations are now indented relative to the text, not the opening '("', code objects can now remove all free vars, the REPL uses global vars. Error API is changing a bit. --- nomsu_compiler.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'nomsu_compiler.lua') diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua index 9b8fc87..2b49112 100644 --- a/nomsu_compiler.lua +++ b/nomsu_compiler.lua @@ -304,7 +304,7 @@ local compile = setmetatable({ lua:add(",") end if lua:trailing_line_len() + #(entry_lua:text():match("^[\n]*")) > MAX_LINE then - lua:add("\n") + lua:add("\n ") elseif needs_comma then lua:add(" ") end @@ -417,6 +417,8 @@ local compile = setmetatable({ if tree[i].type == "Comment" then items_lua:add("\n") sep = '' + elseif items_lua:trailing_line_len() > MAX_LINE then + sep = ',\n ' else sep = ', ' end -- cgit v1.2.3