From 16f3a189fd9b32f599d1271c772e6d4287f95d20 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 18 Apr 2018 15:28:46 -0700 Subject: More working, shifting towards having Lua and Nomsu objects instead of just strings. --- core/metaprogramming.nom | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/metaprogramming.nom') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index 1b65890..011d44d 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -78,13 +78,13 @@ immediately: for i, line in ipairs(\%longhand.value) do lines[i] = line.source:get_text(); end template = repr(table.concat(lines, "\\n")); else - template = repr(\%longhand.source:get_text()); + template = repr(tostring(\%longhand.source:get_text())); end local replacements = {}; for i, a in ipairs(args) do replacements[i] = a.."="..a; end replacements = "{"..table.concat(replacements, ", ").."}"; lua:append([[) - local template = nomsu:parse(]]..template..[[, ]]..repr(tree.source.filename)..[[); + local template = nomsu:parse(Nomsu(]]..repr(tree.source)..[[, ]]..template..[[)); local replacement = nomsu:tree_with_replaced_vars(template, ]]..replacements..[[); return replacement:as_lua(nomsu); end); -- cgit v1.2.3