From 7f47d4204039258cec78c767f489b7809b4257ff Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sat, 17 Nov 2018 14:38:05 -0800 Subject: In-progress (but working) overhaul of some elements including: function calls, lib/thing.nom API, multi-assignments, varargs, etc. --- nomsu_decompiler.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'nomsu_decompiler.lua') diff --git a/nomsu_decompiler.lua b/nomsu_decompiler.lua index 46316d1..19ede3c 100644 --- a/nomsu_decompiler.lua +++ b/nomsu_decompiler.lua @@ -88,6 +88,9 @@ tree_to_inline_nomsu = function(tree) nomsu:append(arg_nomsu) end end + if #tree == 1 and type(tree[1]) ~= "string" then + nomsu:append("()") + end return nomsu elseif "EscapedNomsu" == _exp_0 then local inner_nomsu = tree_to_inline_nomsu(tree[1]) @@ -326,6 +329,13 @@ tree_to_nomsu = function(tree) end end nomsu:append(next_space, words) + next_space = " " + end + if #tree == 1 and type(tree[1]) ~= "string" then + if next_space == " " then + next_space = "" + end + nomsu:append(next_space, "()") end return nomsu elseif "EscapedNomsu" == _exp_0 then -- cgit v1.2.3