aboutsummaryrefslogtreecommitdiff
path: root/nomsu_decompiler.lua
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-17 14:38:05 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-17 14:39:08 -0800
commit7f47d4204039258cec78c767f489b7809b4257ff (patch)
treec8533068b75ab453accfe1f688705e9e94c9e279 /nomsu_decompiler.lua
parent34a3dd22a4e132bd4e0fe3ce89831c3fe761d3d9 (diff)
In-progress (but working) overhaul of some elements including: function
calls, lib/thing.nom API, multi-assignments, varargs, etc.
Diffstat (limited to 'nomsu_decompiler.lua')
-rw-r--r--nomsu_decompiler.lua10
1 files changed, 10 insertions, 0 deletions
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