From b2cec10592b0b3fcd6c8da04fcce709fbf2e5a5e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 17:48:35 -0800 Subject: Fixed `'s` clumping for stuff like (%foo's metatable) --- nomsu_decompiler.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'nomsu_decompiler.lua') diff --git a/nomsu_decompiler.lua b/nomsu_decompiler.lua index 9ff62b1..21facdc 100644 --- a/nomsu_decompiler.lua +++ b/nomsu_decompiler.lua @@ -57,7 +57,12 @@ tree_to_inline_nomsu = function(tree) end for i, bit in ipairs(tree) do if type(bit) == "string" then - local clump_words = (type(tree[i - 1]) == 'string' and is_operator(bit) ~= is_operator(tree[i - 1])) + local clump_words + if type(tree[i - 1]) then + clump_words = is_operator(bit) ~= is_operator(tree[i - 1]) + else + clump_words = is_operator(bit) + end if i > 1 and not clump_words then nomsu:append(" ") end -- cgit v1.2.3