From 0442c8dd216f16c7371873a8e8fd8bf83d30dad0 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 17 Jul 2018 14:12:11 -0700 Subject: Overhaul of comment handling, plus a few fixes (e.g. a fix for indented text that begins with a nomsu comment) --- core/metaprogramming.nom | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'core/metaprogramming.nom') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index 2be7132..17b3be4 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -164,12 +164,11 @@ compile [%tree with %t -> %replacement] to \(%replacement as lua return) end) -compile [%tree with vars %v] to - Lua value ".." - \(%tree as lua expr):map(function(t) - local replacements = \(%v as lua expr) - if t.type == "Var" then - return replacements[t[1]] +action [%tree with vars %replacements] + =lua ".." + \%tree:map(function(\%t) + if \%t.type == "Var" then + return \%replacements[\%t[1]] end end) -- cgit v1.2.3