diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-12 16:33:11 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-12 16:33:11 -0800 |
| commit | 6b09187899e86eabc25ed2ff96f4c2e51f130c00 (patch) | |
| tree | 327179a15dfbc0bf11ad293097252ea4bd241b69 /lib/text.nom | |
| parent | e09f05a50cdb699029e8a4d5bafcfaade34157fd (diff) | |
Switched to use load() with environment table instead of passing in
nomsu to everything. This has some nice code cleanliness benefits.
Diffstat (limited to 'lib/text.nom')
| -rw-r--r-- | lib/text.nom | 4 |
1 files changed, 2 insertions, 2 deletions
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 |
