aboutsummaryrefslogtreecommitdiff
path: root/compatibility/2.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-11 15:50:46 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-11 15:50:46 -0800
commit4efe44ed271aeed8e25e909344788d92a0d9f82b (patch)
tree73766440b53031d4fc8210dbe3b0aece47e6b852 /compatibility/2.nom
parentba03cb67c3c8ba53451eba25dd2186f095cd1db2 (diff)
Fully upgraded to 4.10.12.7, including deprecating the old list/dict
comprehension methods, in favor of the new native support.
Diffstat (limited to 'compatibility/2.nom')
-rw-r--r--compatibility/2.nom21
1 files changed, 11 insertions, 10 deletions
diff --git a/compatibility/2.nom b/compatibility/2.nom
index 84331a6..2ca4526 100644
--- a/compatibility/2.nom
+++ b/compatibility/2.nom
@@ -1,7 +1,7 @@
-#!/usr/bin/env nomsu -V4.8.10
+#!/usr/bin/env nomsu -V4.10.12.7
#
This file defines upgrades from Nomsu 1 to Nomsu 2
-
+
use "compatibility/compatibility.nom"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -15,21 +15,22 @@ upgrade %tree to "2" as:
%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 {..}
- cond:%tree.2 upgraded, true_body:%true_body, false_body:%false_body
+ cond: %tree.2 upgraded, true_body: %true_body, false_body: %false_body
%need_blocks = [..]
- "if", "unless", "for 1 in", "for 1 = 2 in", "repeat while 1"
- "repeat 1 times", "repeat", "repeat until 1", "for 1 in 2 to 3 by"
- "for 1 in 2 to 3 via", "for 1 in 2 to", "for 1 2 in"
- "do", "for 1 in recursive", "test", "with", "result of", "when"
+ "if", "unless", "for 1 in", "for 1 = 2 in", "repeat while 1", "repeat 1 times"
+ "repeat", "repeat until 1", "for 1 in 2 to 3 by", "for 1 in 2 to 3 via"
+ "for 1 in 2 to", "for 1 2 in", "do", "for 1 in recursive", "test", "with", "result of"
+ "when"
for %n in %need_blocks:
if (%tree.stub is %n):
- %bits = (((% upgraded) if (% is syntax tree) else %) for % in %tree)
+ %bits = [: for % in %tree: add ((% upgraded) if (% is syntax tree) else %)]
unless ((%bits::last) is "Block" syntax tree):
%body = (%bits::last)
- %bits.(size of %bits) = (=lua "SyntaxTree{type='Block', source=\%body.source, \%body}")
-
+ %bits.(size of %bits) = (..)
+ =lua "SyntaxTree{type='Block', source=\%body.source, \%body}"
return (=lua "SyntaxTree{type='Action', source=\%tree.source, unpack(\%bits)}")