From b5fb8933af283d2b873a03ded085e8b69f374e81 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 12 Jun 2018 15:12:27 -0700 Subject: Removed dependency on 'immutable' library. This lets LuaJIT do more aggressive optimizations and generally helps performance. Some safety is lost, but I think the performance gains, reduced complexity, and reduced dependencies are worth it. --- core/metaprogramming.nom | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/metaprogramming.nom') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index 83293c1..ec65f3e 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -94,14 +94,14 @@ immediately return replacements[t.value] elseif t.type == 'Var' then return t.type.."("..repr(tostring(t.source))..", "..repr(t.value.."#"..tostring(MANGLE_INDEX))..")" - elseif t.is_multi then + elseif t.value then + return t.type.."("..repr(tostring(t.source))..", "..repr(t.value)..")" + else local bits = {repr(tostring(t.source))} for i, entry in ipairs(t) do bits[#bits+1] = make_tree(entry) end return t.type.."("..table.concat(bits, ", ")..")" - else - return t.type.."("..repr(tostring(t.source))..", "..repr(t.value)..")" end end lua:append(")\n local tree = ", make_tree(\%longhand), "\n return nomsu:tree_to_lua(tree)\nend);") -- cgit v1.2.3