aboutsummaryrefslogtreecommitdiff
path: root/lib/utils2.nom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils2.nom')
-rw-r--r--lib/utils2.nom28
1 files changed, 14 insertions, 14 deletions
diff --git a/lib/utils2.nom b/lib/utils2.nom
index c31d5ab..def8854 100644
--- a/lib/utils2.nom
+++ b/lib/utils2.nom
@@ -25,7 +25,7 @@ compile [with %assignments %action] to code:
%var = (%tokens -> 1)
%eq = (%tokens -> 2)
assert (=lua "vars.eq and vars.eq.type == 'Word' and vars.eq.value == '='") ".."
- |Invalid format for 'with' statement. List entries must have the form %var = (value)
+ Invalid format for 'with' statement. List entries must have the form %var = (value)
%value = (%tokens -> 3)
add (d{i=%i; var=%var; value=%value}) to %data
%foo = (..)
@@ -34,18 +34,18 @@ compile [with %assignments %action] to code:
..for all %data
..with glue "\n "
".."
- |do
- | \(%foo)
- | local fell_through = false;
- | local ok, ret1, ret2 = pcall(function(nomsu, vars)
- | \(%action as lua statements);
- | fell_through = true;
- | end, nomsu, vars);
- | \(join ("\((%->"var") as lua) = old_value\(%->"i");" for all %data) with glue "\n ")
- | if not ok then nomsu:error(ret1); end
- | if not fell_through then
- | return ret1, ret2;
- | end
- |end
+ do
+ \(%foo)
+ local fell_through = false;
+ local ok, ret1, ret2 = pcall(function(nomsu, vars)
+ \(%action as lua statements);
+ fell_through = true;
+ end, nomsu, vars);
+ \(join ("\((%->"var") as lua) = old_value\(%->"i");" for all %data) with glue "\n ")
+ if not ok then nomsu:error(ret1); end
+ if not fell_through then
+ return ret1, ret2;
+ end
+ end
parse [with %thing = %value %action] as: with [%thing = %value] %action