From 5eb1b276adef1ec0755f170380f5b67bb465cee2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 14 Jan 2019 16:29:38 -0800 Subject: Fixed some bugs with append/add discrepancy, misguided ".." matching for needs_space, and list items getting falsely forced into indented form. --- nomsu_decompiler.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'nomsu_decompiler.lua') diff --git a/nomsu_decompiler.lua b/nomsu_decompiler.lua index be71c48..98e93c8 100644 --- a/nomsu_decompiler.lua +++ b/nomsu_decompiler.lua @@ -85,7 +85,7 @@ tree_to_inline_nomsu = function(tree) end end if num_args == 1 and num_words == 0 then - nomsu:append("()") + nomsu:add("()") end return nomsu elseif "MethodCall" == _exp_0 then @@ -432,9 +432,9 @@ tree_to_nomsu = function(tree) end if num_args == 1 and num_words == 0 then if next_space ~= " " then - nomsu:append(next_space) + nomsu:add(next_space) end - nomsu:append("()") + nomsu:add("()") end return nomsu elseif "MethodCall" == _exp_0 then @@ -469,7 +469,7 @@ tree_to_nomsu = function(tree) if i > 1 then nomsu:add("\n") if tree[i - 1].type ~= "Comment" then - needs_space[i] = ((line_nomsu:is_multiline() and prev_line:is_multiline()) or prev_line:text():match("%.%.[^\n]*$")) + needs_space[i] = (line_nomsu:is_multiline() and prev_line:is_multiline()) if tree[i].type == "Comment" or needs_space[i] or needs_space[i - 1] then nomsu:add("\n") end @@ -590,7 +590,7 @@ tree_to_nomsu = function(tree) if i > 1 then sep = '\n' end - item_nomsu = tree_to_nomsu(item) + item_nomsu = item.type == "Action" and tree_to_nomsu(item) or recurse(item) end end nomsu:add(sep) -- cgit v1.2.3