From 6b09187899e86eabc25ed2ff96f4c2e51f130c00 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 12 Jan 2018 16:33:11 -0800 Subject: Switched to use load() with environment table instead of passing in nomsu to everything. This has some nice code cleanliness benefits. --- lib/text.nom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/text.nom') diff --git a/lib/text.nom b/lib/text.nom index 7c06d07..a1331ef 100644 --- a/lib/text.nom +++ b/lib/text.nom @@ -8,7 +8,7 @@ use "lib/metaprogramming.nom" action [join %strs with %glue]: lua> ".." local str_bits = {} - for i,bit in ipairs(\%strs) do str_bits[i] = nomsu:stringify(bit) end + for i,bit in ipairs(\%strs) do str_bits[i] = stringify(bit) end return table.concat(str_bits, \%glue) parse [join %strs] as: join %strs with "" @@ -49,7 +49,7 @@ lua do> ".." local color = "'"..c.."'"; local reset = "'"..colors["reset color"].."'"; nomsu:define_compile_action(name, \(__line_no__), function() return {expr=color}; end, \(__src__ 1)); - nomsu:define_compile_action(name.." %", \(__line_no__), function(nomsu, _) + nomsu:define_compile_action(name.." %", \(__line_no__), function(_) return {expr=color..".."..nomsu:tree_to_lua(_).expr..".."..reset}; end, \(__src__ 1)); end -- cgit v1.2.3