aboutsummaryrefslogtreecommitdiff
path: root/compatibility/2.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-20 20:27:15 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-20 20:27:27 -0700
commit6728587dfc6a5f4090f2673113ffedb2be924daf (patch)
tree77591abacd8760bedaa30110570613ef263220fe /compatibility/2.nom
parentc9df1bc3e881b2ebcf5808a0db7bea29cd07c849 (diff)
Auto-formatted and auto-upgraded everything!
Diffstat (limited to 'compatibility/2.nom')
-rw-r--r--compatibility/2.nom17
1 files changed, 10 insertions, 7 deletions
diff --git a/compatibility/2.nom b/compatibility/2.nom
index a93730c..36917b1 100644
--- a/compatibility/2.nom
+++ b/compatibility/2.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V2.3.4.3
+#!/usr/bin/env nomsu -V2.5.4.3
use "core"
use "compatibility/compatibility.nom"
@@ -8,23 +8,26 @@ upgrade %tree to "2" as:
%true_body = (%tree.3 upgraded)
unless (%true_body is "Block" syntax tree):
%true_body = (=lua "Block(\%true_body.source, \%true_body)")
+
%false_body = (%tree.5 upgraded)
unless (%false_body is "Block" syntax tree):
%false_body = (=lua "Block(\%false_body.source, \%false_body)")
+
return (..)
- \(if %cond %true_body else %false_body)
- ..with vars {..}
+ \(if %cond %true_body else %false_body) with vars {..}
cond:%tree.2 upgraded, true_body:%true_body, false_body:%false_body
%need_blocks = [..]
"if % %", "unless % %", "for % in % %", "for % = % in % %", "repeat while % %"
- "repeat % times %", "repeat %", "repeat until % %", "for % in % to % by % %",
- "for % in % to % via % %", "for % in % to % %", "for % % in % %", "do %"
- "for % in recursive % %", "test %", "with % %", "result of %"
+ "repeat % times %", "repeat %", "repeat until % %", "for % in % to % by % %"
+ "for % in % to % via % %", "for % in % to % %", "for % % in % %"
+ "do %", "for % in recursive % %", "test %", "with % %", "result of %"
+
for %n in %need_blocks:
if (%tree.stub is %n):
%bits = (((% upgraded) if (% is syntax tree) else %) for % in %tree)
unless ((last in %bits) is "Block" syntax tree):
%body = (last in %bits)
%bits.(length of %bits) = (=lua "Block(\%body.source, \%body)")
- return (=lua "Action(\%tree.source, unpack(\%bits))")
+
+ return (=lua "Action(\%tree.source, unpack(\%bits))") \ No newline at end of file