aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-17 14:12:11 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-17 14:12:51 -0700
commit0442c8dd216f16c7371873a8e8fd8bf83d30dad0 (patch)
treef3ca5f178b9851d27d95bf060f966e2398ef9a6a /core
parentbe06fc096aa28358914bd6a76b4ea380a04b8873 (diff)
Overhaul of comment handling, plus a few fixes (e.g. a fix for indented
text that begins with a nomsu comment)
Diffstat (limited to 'core')
-rw-r--r--core/metaprogramming.nom11
1 files changed, 5 insertions, 6 deletions
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)