diff options
Diffstat (limited to 'compatibility')
| -rw-r--r-- | compatibility/2.3.nom | 26 | ||||
| -rw-r--r-- | compatibility/2.4.nom | 96 | ||||
| -rw-r--r-- | compatibility/2.5.5.5.nom | 10 | ||||
| -rw-r--r-- | compatibility/2.5.nom | 10 | ||||
| -rw-r--r-- | compatibility/2.nom | 42 | ||||
| -rw-r--r-- | compatibility/3.5.5.6.nom | 6 | ||||
| -rw-r--r-- | compatibility/3.6.nom | 35 | ||||
| -rw-r--r-- | compatibility/3.7.nom | 46 | ||||
| -rw-r--r-- | compatibility/3.8.nom | 30 | ||||
| -rw-r--r-- | compatibility/3.nom | 14 | ||||
| -rw-r--r-- | compatibility/4.10.12.7.nom | 102 | ||||
| -rw-r--r-- | compatibility/4.11.nom | 108 | ||||
| -rw-r--r-- | compatibility/4.12.nom | 14 | ||||
| -rw-r--r-- | compatibility/4.8.10.nom | 74 | ||||
| -rw-r--r-- | compatibility/4.9.nom | 8 | ||||
| -rw-r--r-- | compatibility/compatibility.nom | 174 |
16 files changed, 391 insertions, 404 deletions
diff --git a/compatibility/2.3.nom b/compatibility/2.3.nom index 21eb2f2..daf3c36 100644 --- a/compatibility/2.3.nom +++ b/compatibility/2.3.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <2.3 to Nomsu 2.3 @@ -6,15 +6,15 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action (%a = %b) to "2.3" as (%a == %b) -upgrade action (<- %) to "2.3" as (set %) -upgrade action (assign %) to "2.3" as (set %) -upgrade action (%a <- %b) to "2.3" as (%a = %b) -upgrade action (external %a <- %b) to "2.3" as (external %a = %b) -upgrade action (%a +<- %b) to "2.3" as (%a += %b) -upgrade action (%a -<- %b) to "2.3" as (%a -= %b) -upgrade action (%a *<- %b) to "2.3" as (%a *= %b) -upgrade action (%a /<- %b) to "2.3" as (%a /= %b) -upgrade action (%a ^<- %b) to "2.3" as (%a ^= %b) -upgrade action (%a and<- %b) to "2.3" as (%a and= %b) -upgrade action (%a or<- %b) to "2.3" as (%a or= %b) +upgrade action ($a = $b) to "2.3" as ($a == $b) +upgrade action (<- $) to "2.3" as (set $) +upgrade action (assign $) to "2.3" as (set $) +upgrade action ($a <- $b) to "2.3" as ($a = $b) +upgrade action (external $a <- $b) to "2.3" as (external $a = $b) +upgrade action ($a +<- $b) to "2.3" as ($a += $b) +upgrade action ($a -<- $b) to "2.3" as ($a -= $b) +upgrade action ($a *<- $b) to "2.3" as ($a *= $b) +upgrade action ($a /<- $b) to "2.3" as ($a /= $b) +upgrade action ($a ^<- $b) to "2.3" as ($a ^= $b) +upgrade action ($a and<- $b) to "2.3" as ($a and= $b) +upgrade action ($a or<- $b) to "2.3" as ($a or= $b) diff --git a/compatibility/2.4.nom b/compatibility/2.4.nom index edc9f38..1d5463b 100644 --- a/compatibility/2.4.nom +++ b/compatibility/2.4.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <2.4 to Nomsu 2.4 @@ -6,69 +6,65 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade %tree to "2.4" as: - unless (%tree is "Action" syntax tree): return - if %tree.stub is: +upgrade $tree to "2.4" as: + unless ($tree is "Action" syntax tree): return + if $tree.stub is: "when" "if": - if ((size of %tree) == 3): return %tree - %conditions = [] - %new_lines = [] - %body = ((%tree.2 upgraded) if (%tree.2 is "Block" syntax tree) else [%tree.2 upgraded]) - for %line in %body: + if ((size of $tree) == 3): return $tree + $conditions = [] + $new_lines = [] + $body = (($tree.2 upgraded) if ($tree.2 is "Block" syntax tree) else [$tree.2 upgraded]) + for $line in $body: when: - (not (%line is "Action" syntax tree)): - %new_lines::add %line - - (%line.stub is "*"): - if ((size of %line) == 2): - %conditions::add %line.2 + (not ($line is "Action" syntax tree)): $new_lines|add $line + ($line.stub is "*"): + if ((size of $line) == 2): + $conditions|add $line.2 ..else: - %new_lines::add %line + $new_lines|add $line - (%line.stub == "* else"): - %new_lines::add (\(else %block) with vars {block: %line.3}) + ($line.stub == "* else"): + $new_lines|add (\(else $block) with vars {block: $line.3}) else: - %conditions::add %line.2 - %action = %line.3 - unless (%action is "Block" syntax tree): - %action = (=lua "SyntaxTree{type='Block', source=\%action.source, \%action}") - %conditions::add %action - %new_lines::add (..) - =lua "SyntaxTree{type='Action', source=\%conditions[1].source, unpack(\%conditions)}" - %conditions = [] + $conditions|add $line.2 + $action = $line.3 + unless ($action is "Block" syntax tree): + $action = (=lua "SyntaxTree{type='Block', source=\$action.source, \$action}") + $conditions|add $action + $new_lines| + add (=lua "SyntaxTree{type='Action', source=\$conditions[1].source, unpack(\$conditions)}") + $conditions = [] return (..) - \(when %body) with vars {..} - body: =lua "SyntaxTree{type='Block', source=\%tree[2].source, unpack(\%new_lines)}" + \(when $body) with vars {..} + body: =lua "SyntaxTree{type='Block', source=\$tree[2].source, unpack(\$new_lines)}" "if 1 is ?" "if 1 = ?": - %values = [] - %new_lines = [] - %body = ((%tree.5 upgraded) if (%tree.5 is "Block" syntax tree) else [%tree.5 upgraded]) - for %line in %body: + $values = [] + $new_lines = [] + $body = (($tree.5 upgraded) if ($tree.5 is "Block" syntax tree) else [$tree.5 upgraded]) + for $line in $body: when: - (not (%line is "Action" syntax tree)): - %new_lines::add %line - - (%line.stub is "*"): - if ((size of %line) == 2): - %values::add %line.2 + (not ($line is "Action" syntax tree)): $new_lines|add $line + ($line.stub is "*"): + if ((size of $line) == 2): + $values|add $line.2 ..else: - %new_lines::add %line + $new_lines|add $line - (%line.stub == "* else"): - %new_lines::add (\(else %block) with vars {block: %line.3}) + ($line.stub == "* else"): + $new_lines|add (\(else $block) with vars {block: $line.3}) else: - %values::add %line.2 - %action = %line.3 - unless (%action is "Block" syntax tree): %action = \(: %action) - %values::add %action - %new_lines::add (..) - =lua "SyntaxTree{type='Action', source=\%values[1].source, unpack(\%values)}" - %values = [] + $values|add $line.2 + $action = $line.3 + unless ($action is "Block" syntax tree): $action = \(: $action) + $values|add $action + $new_lines| + add (=lua "SyntaxTree{type='Action', source=\$values[1].source, unpack(\$values)}") + $values = [] return (..) - \(if %var is %body) with vars {..} - var: %tree.2 upgraded, body: =lua "SyntaxTree{type='Block', source=\%tree[5].source, unpack(\%new_lines)}" + \(if $var is $body) with vars {..} + var: $tree.2 upgraded, body: =lua "SyntaxTree{type='Block', source=\$tree[5].source, unpack(\$new_lines)}" diff --git a/compatibility/2.5.5.5.nom b/compatibility/2.5.5.5.nom index 34bc513..aff4b78 100644 --- a/compatibility/2.5.5.5.nom +++ b/compatibility/2.5.5.5.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <2.5.5.5 to Nomsu 2.5.5.5 @@ -6,9 +6,9 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action [hash %, sha1 %] to "2.5.5.5" as (..) - =lua "\(base64 decode (hash %)):gsub('.', function(c) return ('%x02'):format(c) end)" +upgrade action [hash $, sha1 $] to "2.5.5.5" as (..) + =lua "\(base64 decode (hash $)):gsub('.', function(c) return ('%x02'):format(c) end)" -upgrade action [file with hash %] to "2.5.5.5" as (..) +upgrade action [file with hash $] to "2.5.5.5" as (..) file with hash (..) - base64 (=lua "\%:gsub('..', function(xx) return string.char(tonumber(xx, 16)) end)") + base64 (=lua "\$:gsub('..', function(xx) return string.char(tonumber(xx, 16)) end)") diff --git a/compatibility/2.5.nom b/compatibility/2.5.nom index 3e11a85..b83f156 100644 --- a/compatibility/2.5.nom +++ b/compatibility/2.5.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <2.5 to Nomsu 2.5 @@ -6,8 +6,8 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action (for %1 where %2 matches %3 %4) to "2.5" as (..) - for %1 in %2 matching %3 %4 +upgrade action (for $1 where $2 matches $3 $4) to "2.5" as (..) + for $1 in $2 matching $3 $4 -upgrade action (%1 for %2 where %3 matches %4) to "2.5" as (..) - %1 for %2 in %3 matching %4 +upgrade action ($1 for $2 where $3 matches $4) to "2.5" as (..) + $1 for $2 in $3 matching $4 diff --git a/compatibility/2.nom b/compatibility/2.nom index 8004e42..03e2db7 100644 --- a/compatibility/2.nom +++ b/compatibility/2.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu 1 to Nomsu 2 @@ -6,31 +6,31 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade %tree to "2" as: - unless (%tree is "Action" syntax tree): return - if (%tree.stub is "if 1 2 else"): - %true_body = (%tree.3 upgraded) - unless (%true_body is "Block" syntax tree): - %true_body = \(: %true_body) - %false_body = (%tree.5 upgraded) - unless (%false_body is "Block" syntax tree): - %false_body = (=lua "Block(\%false_body.source, \%false_body)") +upgrade $tree to "2" as: + unless ($tree is "Action" syntax tree): return + if ($tree.stub is "if 1 2 else"): + $true_body = ($tree.3 upgraded) + unless ($true_body is "Block" syntax tree): + $true_body = \(: $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 {..} - cond: %tree.2 upgraded, true_body: %true_body, false_body: %false_body + \(if $cond $true_body else $false_body) with vars {..} + cond: $tree.2 upgraded, true_body: $true_body, false_body: $false_body - %need_blocks = [..] + $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" - for %n in %need_blocks: - if (%tree.stub is %n): - %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}" - return (=lua "SyntaxTree{type='Action', source=\%tree.source, unpack(\%bits)}") + for $n in $need_blocks: + if ($tree.stub is $n): + $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}" + return (=lua "SyntaxTree{type='Action', source=\$tree.source, unpack(\$bits)}") diff --git a/compatibility/3.5.5.6.nom b/compatibility/3.5.5.6.nom index 7131d5e..0d5f307 100644 --- a/compatibility/3.5.5.6.nom +++ b/compatibility/3.5.5.6.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <3.5.5.6 to Nomsu 3.5.5.6 @@ -7,5 +7,5 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upgrade action "traceback" to "3.5.5.6" via (..) - for %tree: - compile error at %tree "'traceback' has been deprecated." + for $tree: + compile error at $tree "'traceback' has been deprecated." diff --git a/compatibility/3.6.nom b/compatibility/3.6.nom index 94abf07..d2f9bb6 100644 --- a/compatibility/3.6.nom +++ b/compatibility/3.6.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <3.6 to 3.6 @@ -7,24 +7,23 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upgrade action [..] - append %item to %list, add %item to %list, to %list add %item, to %list append %item -..to "3.6" as (%list::add %item) + append $item to $list, add $item to $list, to $list add $item, to $list append $item +..to "3.6" as ($list|add $item) -upgrade action [add %item to %list at index %i] to "3.6" as (..) - %list::at index %i add %item +upgrade action [add $item to $list at index $i] to "3.6" as (..) + $list|at index $i add $item -upgrade action [pop from %list, remove last from %list] to "3.6" as (%list::pop) -upgrade action [remove index %index from %list] to "3.6" as (..) - %list::remove index %index -upgrade action [to %1 write %2, %1 <-write %2] to "3.6" as (%1::add %2) -upgrade action [to %1 write %2 joined by %3] to "3.6" as (..) - %1::add %2 joined by %3 -upgrade action [declare locals in %lua] to "3.6" as (%lua::declare locals) -upgrade action [declare locals %locs in %lua] to "3.6" as (..) - %lua::declare locals %locs +upgrade action [pop from $list, remove last from $list] to "3.6" as ($list|pop) +upgrade action [remove index $index from $list] to "3.6" as (..) + $list|remove index $index +upgrade action [to $1 write $2, $1 <-write $2] to "3.6" as ($1|add $2) +upgrade action [to $1 write $2 joined by $3] to "3.6" as ($1|add $2 joined by $3) +upgrade action [declare locals in $lua] to "3.6" as ($lua|declare locals) +upgrade action [declare locals $locs in $lua] to "3.6" as (..) + $lua|declare locals $locs -upgrade action [add free vars %vars to %lua] to "3.6" as (..) - %lua::add free vars %vars +upgrade action [add free vars $vars to $lua] to "3.6" as (..) + $lua|add free vars $vars -upgrade action [remove free vars %vars from %lua] to "3.6" as (..) - %lua::remove free vars %vars +upgrade action [remove free vars $vars from $lua] to "3.6" as (..) + $lua|remove free vars $vars diff --git a/compatibility/3.7.nom b/compatibility/3.7.nom index 9bbc4ba..777585b 100644 --- a/compatibility/3.7.nom +++ b/compatibility/3.7.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <3.7 to 3.7 @@ -6,36 +6,28 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action [%index st to last in %list] to "3.7" as (..) - %list::%index st to last - -upgrade action [%index nd to last in %list] to "3.7" as (..) - %list::%index nd to last - -upgrade action [%index rd to last in %list] to "3.7" as (..) - %list::%index rd to last - -upgrade action [%index th to last in %list] to "3.7" as (..) - %list::%index rd th last - -upgrade action [last in %list] to "3.7" as (%list::last) -upgrade action [first in %list] to "3.7" as (%list::first) -upgrade action [%item is in %list, %list contains %item, %list has %item] to \ -.."3.7" as (%list::has %item) +upgrade action [$index st to last in $list] to "3.7" as ($list|$index st to last) +upgrade action [$index nd to last in $list] to "3.7" as ($list|$index nd to last) +upgrade action [$index rd to last in $list] to "3.7" as ($list|$index rd to last) +upgrade action [$index th to last in $list] to "3.7" as ($list|$index rd th last) +upgrade action [last in $list] to "3.7" as ($list|last) +upgrade action [first in $list] to "3.7" as ($list|first) +upgrade action [$item is in $list, $list contains $item, $list has $item] to \ +.."3.7" as ($list|has $item) upgrade action [..] - %item isn't in %list, %item is not in %list, %list doesn't contain %item - %list does not contain %item, %list doesn't have %item, %list does not have %item -..to "3.7" as (not (%list::has %item)) + $item isn't in $list, $item is not in $list, $list doesn't contain $item + $list does not contain $item, $list doesn't have $item, $list does not have $item +..to "3.7" as (not ($list|has $item)) -upgrade action [%list has key %index, %list has index %index] to "3.7" as (..) - %list.%index != (nil) +upgrade action [$list has key $index, $list has index $index] to "3.7" as (..) + $list.$index != (nil) upgrade action [..] - %list doesn't have key %index, %list does not have key %index - %list doesn't have index %index, %list does not have index %index -..to "3.7" as (%list.%index == (nil)) + $list doesn't have key $index, $list does not have key $index + $list doesn't have index $index, $list does not have index $index +..to "3.7" as ($list.$index == (nil)) upgrade action [..] - number of keys in %list, len %list, || %list ||, length %list, length of %list -..to "3.7" as (size of %list) + number of keys in $list, len $list, || $list ||, length $list, length of $list +..to "3.7" as (size of $list) diff --git a/compatibility/3.8.nom b/compatibility/3.8.nom index 12d656e..7de2c71 100644 --- a/compatibility/3.8.nom +++ b/compatibility/3.8.nom @@ -1,19 +1,19 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <3.8 to 3.8 (Text method changes) -upgrade action [%texts joined with %glue] to "3.8" as (%texts::joined with %glue) -upgrade action [%texts joined, joined %texts] to "3.8" as (%texts::joined) -upgrade action [byte %i of %text] to "3.8" as (%text::byte %i) -upgrade action [bytes %start to %stop of %text] to "3.8" as (..) - %text::bytes %start to %stop -upgrade action [bytes of %text] to "3.8" as (%text::bytes) -upgrade action [capitalized %text, %text capitalized] to "3.8" as (..) - %text::capitalized -upgrade action [uppercase %text, %text uppercase] to "3.8" as (%text::uppercase) +upgrade action [$texts joined with $glue] to "3.8" as ($texts|joined with $glue) +upgrade action [$texts joined, joined $texts] to "3.8" as ($texts|joined) +upgrade action [byte $i of $text] to "3.8" as ($text|byte $i) +upgrade action [bytes $start to $stop of $text] to "3.8" as (..) + $text|bytes $start to $stop +upgrade action [bytes of $text] to "3.8" as ($text|bytes) +upgrade action [capitalized $text, $text capitalized] to "3.8" as (..) + $text|capitalized +upgrade action [uppercase $text, $text uppercase] to "3.8" as ($text|uppercase) upgrade action [..] - %text with %sub instead of %patt, %text with %patt replaced by %sub - %text s/ %patt / %sub -..to "3.8" as (%text::with %patt -> %sub) -upgrade action [%text matches %pattern] to "3.8" as (%text::matches %pattern) -upgrade action [%text matching %pattern] to "3.8" as (%text::matching %pattern).1 + $text with $sub instead of $patt, $text with $patt replaced by $sub + $text s/ $patt / $sub +..to "3.8" as ($text|with $patt -> $sub) +upgrade action [$text matches $pattern] to "3.8" as ($text|matches $pattern) +upgrade action [$text matching $pattern] to "3.8" as ($text|matching $pattern).1 diff --git a/compatibility/3.nom b/compatibility/3.nom index cad5de9..d6d71ad 100644 --- a/compatibility/3.nom +++ b/compatibility/3.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <=2 to Nomsu 3 @@ -6,10 +6,10 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action (method %spec %body) to "3" as (my action %spec %body) -upgrade action (me) to "3" as %me -upgrade action (@) to "3" as %me +upgrade action (method $spec $body) to "3" as (my action $spec $body) +upgrade action (me) to "3" as $me +upgrade action (@) to "3" as $me upgrade action "as" to "3" via (..) - for %tree: - compile error at %tree "Object API has changed and 'as' is no longer supported." "\ - ..Use (%obj::action ...) instead of (as %obj: action ...)" + for $tree: + compile error at $tree "Object API has changed and 'as' is no longer supported." \ + .."Use (%obj::action ...) instead of (as %obj: action ...)" diff --git a/compatibility/4.10.12.7.nom b/compatibility/4.10.12.7.nom index 5887684..c5abe1a 100644 --- a/compatibility/4.10.12.7.nom +++ b/compatibility/4.10.12.7.nom @@ -1,80 +1,80 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <4.10.12.7 to 4.10.12.7 use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -upgrade action (% as lua statements) to "4.10.12.7" as (% as lua) -upgrade action (% as lua return) to "4.10.12.7" as (..) - =lua "\%.type == 'Block' and \(% as lua) or 'return '..\(% as lua expr)" -upgrade action (Lua value %) to "4.10.12.7" as (Lua %) -upgrade action (%e for % in %items) to "4.10.12.7" as [: for % in %items: add %e] -upgrade action (%e for %k = %v in %items) to "4.10.12.7" as [..] - : for %k = %v in %items: add %e +upgrade action ($ as lua statements) to "4.10.12.7" as ($ as lua) +upgrade action ($ as lua return) to "4.10.12.7" as (..) + =lua "\$.type == 'Block' and \($ as lua) or 'return '..\($ as lua expr)" +upgrade action (Lua value $) to "4.10.12.7" as (Lua $) +upgrade action ($e for $ in $items) to "4.10.12.7" as [: for $ in $items: add $e] +upgrade action ($e for $k = $v in $items) to "4.10.12.7" as [..] + : for $k = $v in $items: add $e -upgrade action (%e for %i in %start to %stop) to "4.10.12.7" as [..] - : for %i in %start to %stop: add %e +upgrade action ($e for $i in $start to $stop) to "4.10.12.7" as [..] + : for $i in $start to $stop: add $e -upgrade action (%e for %i in %start to %stop by %step) to "4.10.12.7" as [..] - : for %i in %start to %stop by %step: add %e +upgrade action ($e for $i in $start to $stop by $step) to "4.10.12.7" as [..] + : for $i in $start to $stop by $step: add $e -upgrade action (%e for %i in %start to %stop via %step) to "4.10.12.7" as [..] - : for %i in %start to %stop by %step: add %e +upgrade action ($e for $i in $start to $stop via $step) to "4.10.12.7" as [..] + : for $i in $start to $stop by $step: add $e -upgrade action (%k = %v for % in %items) to "4.10.12.7" as {..} - : for % in %items: add %k = %v +upgrade action ($k = $v for $ in $items) to "4.10.12.7" as {..} + : for $ in $items: add $k = $v -upgrade action (%k = %v for %k0 = %v0 in %items) to "4.10.12.7" as {..} - : for %k0 = %v0 in %items: add %k = %v +upgrade action ($k = $v for $k0 = $v0 in $items) to "4.10.12.7" as {..} + : for $k0 = $v0 in $items: add $k = $v -upgrade action (%k = %v for %i in %start to %stop) to "4.10.12.7" as {..} - : for %i in %start to %stop: add %k = %v +upgrade action ($k = $v for $i in $start to $stop) to "4.10.12.7" as {..} + : for $i in $start to $stop: add $k = $v -upgrade action (%k = %v for %i in %start to %stop by %step) to "4.10.12.7" as {..} - : for %i in %start to %stop by %step: add %k = %v +upgrade action ($k = $v for $i in $start to $stop by $step) to "4.10.12.7" as {..} + : for $i in $start to $stop by $step: add $k = $v -upgrade action (%k = %v for %i in %start to %stop via %step) to "4.10.12.7" as {..} - : for %i in %start to %stop by %step: add %k = %v +upgrade action ($k = $v for $i in $start to $stop via $step) to "4.10.12.7" as {..} + : for $i in $start to $stop by $step: add $k = $v -upgrade action (parse %text from %filename) to "4.10.12.7" as (..) - (NomsuCode from (Source %filename 1 (size of %text)) %text) parsed +upgrade action (parse $text from $filename) to "4.10.12.7" as (..) + (NomsuCode from (Source $filename 1 (size of $text)) $text) parsed -upgrade action (% as lua statements) to "4.10.12.7" as (% as lua) -upgrade action (compile error at %pos %err hint %hint) to "4.10.12.7" as (..) - compile error at %pos %err %hint +upgrade action ($ as lua statements) to "4.10.12.7" as ($ as lua) +upgrade action (compile error at $pos $err hint $hint) to "4.10.12.7" as (..) + compile error at $pos $err $hint # In old code, it was okay to have imports at the top of the file in the same chunk, but changes to the API now require imports to be in their own file chunk in order for compilation to work properly. -upgrade %tree to "4.10.12.7" as: - if (%tree.type == "FileChunks"): - %first_chunk = %tree.1 - %i = 1 - %has_use = (no) - repeat while (%i <= (size of %first_chunk)): - if ((%first_chunk.%i.type == "Action") and (%first_chunk.%i.stub == "use")): - %has_use = (yes) +upgrade $tree to "4.10.12.7" as: + if ($tree.type == "FileChunks"): + $first_chunk = $tree.1 + $i = 1 + $has_use = (no) + repeat while ($i <= (size of $first_chunk)): + if (($first_chunk.$i.type == "Action") and ($first_chunk.$i.stub == "use")): + $has_use = (yes) ..else: - if %has_use: + if $has_use: go to (insert chunk) - %i += 1 + $i += 1 return --- (insert chunk) --- - [%chunk1, %chunk2] = [..] - SyntaxTree {type: "Block", source: %first_chunk.source} - SyntaxTree {type: "Block", source: %first_chunk.source} + [$chunk1, $chunk2] = [..] + SyntaxTree {type: "Block", source: $first_chunk.source} + SyntaxTree {type: "Block", source: $first_chunk.source} - for %j in 1 to (%i - 1): - %chunk1.%j = %first_chunk.%j + for $j in 1 to ($i - 1): + $chunk1.$j = $first_chunk.$j - for %j in %i to (size of %first_chunk): - %chunk2.(%j - %i + 1) = %first_chunk.%j + for $j in $i to (size of $first_chunk): + $chunk2.($j - $i + 1) = $first_chunk.$j - %new_tree = (..) - SyntaxTree {source: %tree.source, type: "FileChunks", 1: %chunk1, 2: %chunk2} + $new_tree = (..) + SyntaxTree {source: $tree.source, type: "FileChunks", 1: $chunk1, 2: $chunk2} - for %i in 2 to (size of %tree): - %new_tree.(%i + 1) = %tree.%i + for $i in 2 to (size of $tree): + $new_tree.($i + 1) = $tree.$i - return %new_tree + return $new_tree diff --git a/compatibility/4.11.nom b/compatibility/4.11.nom index 5226895..38751d9 100644 --- a/compatibility/4.11.nom +++ b/compatibility/4.11.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <4.11 to Nomsu 4.11 (overhaul of function literals, deleting (if all of ...), etc. shorthand) @@ -9,87 +9,87 @@ use "compatibility/compatibility.nom" # Overhaul of function literals: upgrade action "call 1 with" to "4.11" via (..) - for (%tree %end_version): - %tree2 = {type: "Action", source: %tree.source, 1: %tree.2} - for %arg in %tree.4 at %i: - %tree2.(%i + 1) = %arg - return (SyntaxTree %tree2) -upgrade action (-> %yield_value) to "4.11" as (yield %yield_value) + for ($tree $end_version): + $tree2 = {type: "Action", source: $tree.source, 1: $tree.2} + for $arg in $tree.4 at $i: + $tree2.($i + 1) = $arg + return (SyntaxTree $tree2) +upgrade action (-> $yield_value) to "4.11" as (yield $yield_value) # Replace set {%x:1, %y:2} with [%x, %y] = [1, 2] upgrade action "set" to "4.11" via (..) - for (%tree %end_version): - [%lhs, %rhs] = [\[], \[]] - %lhs.source = %tree.(2).source - %rhs.source = %tree.(2).source - for %entry in %tree.2 at %i: - %lhs.%i = %entry.1 - %rhs.%i = %entry.2 - return (SyntaxTree {type: "Action", source: %tree.source, 1: %lhs, 2: "=", 3: %rhs}) + for ($tree $end_version): + [$lhs, $rhs] = [\[], \[]] + $lhs.source = $tree.2.source + $rhs.source = $tree.2.source + for $entry in $tree.2 at $i: + $lhs.$i = $entry.1 + $rhs.$i = $entry.2 + return (SyntaxTree {type: "Action", source: $tree.source, 1: $lhs, 2: "=", 3: $rhs}) upgrade action "1 with 2 ~>" to "4.11" via (..) - for %tree: - compile error at %tree "This method has been deprecated." "\ - ..Perhaps this could be use %tree::map instead." + for $tree: + compile error at $tree "This method has been deprecated." \ + .."Perhaps this could be use %tree::map instead." # Changing filesystem API: -upgrade action (for file %f in %path %body) to "4.11" as (..) - for %f in (files for %path) %body +upgrade action (for file $f in $path $body) to "4.11" as (..) + for $f in (files for $path) $body -upgrade action (%expr for file %f in %path) to "4.11" as [..] - : for %f in (files for %path): add %expr +upgrade action ($expr for file $f in $path) to "4.11" as [..] + : for $f in (files for $path): add $expr -upgrade action (line %n in %text) to "4.11" as (%text::line %n) -upgrade action (line number of %pos in %text) to "4.11" as (..) - %text::line number at %pos +upgrade action (line $n in $text) to "4.11" as ($text|line $n) +upgrade action (line number of $pos in $text) to "4.11" as (..) + $text|line number at $pos # Deduplicating goto labels: -upgrade action [=== %label ===, *** %label ***] to "4.11" as (--- %label ---) -upgrade action [===stop %label ===, ***stop %label ***] to "4.11" as (..) - ---stop %label --- +upgrade action [=== $label ===, *** $label ***] to "4.11" as (--- $label ---) +upgrade action [===stop $label ===, ***stop $label ***] to "4.11" as (..) + ---stop $label --- -upgrade action [===next %label ===, ***next %label ***] to "4.11" as (..) - ---next %label --- +upgrade action [===next $label ===, ***next $label ***] to "4.11" as (..) + ---next $label --- # Deprecating shorthand functions: -upgrade action [if all of %items %body, if all of %items then %body] to "4.11" as (..) - if (all of %items) %body +upgrade action [if all of $items $body, if all of $items then $body] to "4.11" as (..) + if (all of $items) $body -upgrade action [unless all of %items %body, unless all of %items then %body] to \ -.."4.11" as (if (not (all of %items)) %body) +upgrade action [unless all of $items $body, unless all of $items then $body] to \ +.."4.11" as (if (not (all of $items)) $body) -upgrade action [if any of %items %body, if any of %items then %body] to "4.11" as (..) - if (any of %items) %body +upgrade action [if any of $items $body, if any of $items then $body] to "4.11" as (..) + if (any of $items) $body -upgrade action [unless any of %items %body, unless any of %items then %body] to \ -.."4.11" as (if (not (any of %items)) %body) +upgrade action [unless any of $items $body, unless any of $items then $body] to \ +.."4.11" as (if (not (any of $items)) $body) -upgrade action [if none of %items %body, if none of %items then %body] to "4.11" \ -..as (if (not (any of %items)) %body) +upgrade action [if none of $items $body, if none of $items then $body] to "4.11" \ +..as (if (not (any of $items)) $body) -upgrade action [unless none of %items %body, unless none of %items then %body] to \ -.."4.11" as (if (any of %items) %body) +upgrade action [unless none of $items $body, unless none of $items then $body] to \ +.."4.11" as (if (any of $items) $body) upgrade action [..] - if all of %items %body else %else, if all of %items then %body else %else -..to "4.11" as (if (all of %items) %body else %else) + if all of $items $body else $else, if all of $items then $body else $else +..to "4.11" as (if (all of $items) $body else $else) upgrade action [..] - unless all of %items %body else %else, unless all of %items then %body else %else -..to "4.11" as (if (not (all of %items)) %body else %else) + unless all of $items $body else $else, unless all of $items then $body else $else +..to "4.11" as (if (not (all of $items)) $body else $else) upgrade action [..] - if any of %items %body else %else, if any of %items then %body else %else -..to "4.11" as (if (any of %items) %body else %else) + if any of $items $body else $else, if any of $items then $body else $else +..to "4.11" as (if (any of $items) $body else $else) upgrade action [..] - unless any of %items %body else %else, unless any of %items then %body else %else -..to "4.11" as (if (not (any of %items)) %body else %else) + unless any of $items $body else $else, unless any of $items then $body else $else +..to "4.11" as (if (not (any of $items)) $body else $else) upgrade action [..] - if none of %items %body else %else, if none of %items then %body else %else -..to "4.11" as (if (not (any of %items)) %body else %else) + if none of $items $body else $else, if none of $items then $body else $else +..to "4.11" as (if (not (any of $items)) $body else $else) upgrade action [..] - unless none of %items %body else %else, unless none of %items then %body else %else -..to "4.11" as (if (any of %items) %body else %else) + unless none of $items $body else $else, unless none of $items then $body else $else +..to "4.11" as (if (any of $items) $body else $else) diff --git a/compatibility/4.12.nom b/compatibility/4.12.nom index 24809ab..63525c6 100644 --- a/compatibility/4.12.nom +++ b/compatibility/4.12.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <4.11 to Nomsu 4.11 (overhaul of function literals, deleting (if all of ...), etc. shorthand) @@ -8,11 +8,11 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upgrade action "do next repeat" to "4.12" via (..) - for %tree: - compile error at %tree "This method has been deprecated." "\ - ..Use either (do next) or (go to (label)) instead." + for $tree: + compile error at $tree "This method has been deprecated." \ + .."Use either (do next) or (go to (label)) instead." upgrade action "stop repeating" to "4.12" via (..) - for %tree: - compile error at %tree "This method has been deprecated." "\ - ..Use either (stop) or (go to (label)) instead." + for $tree: + compile error at $tree "This method has been deprecated." \ + .."Use either (stop) or (go to (label)) instead." diff --git a/compatibility/4.8.10.nom b/compatibility/4.8.10.nom index 78ef6a6..58b9818 100644 --- a/compatibility/4.8.10.nom +++ b/compatibility/4.8.10.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <4.8.10 to 4.8.10 (renaming "action" -> "means") use "compatibility/compatibility.nom" @@ -6,63 +6,63 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upgrade action "local action" to "4.8.10" via (..) - for (%tree %end_version): - %spec = %tree.3 - %body = %tree.4 - if %spec.type is: + for ($tree $end_version): + $spec = $tree.3 + $body = $tree.4 + if $spec.type is: "List": - if ((size of %spec) == 1): - return \(%spec.1 means %body) + if ((size of $spec) == 1): + return \($spec.1 means $body) ..else: - return \(%spec all mean %body) + return \($spec all mean $body) else: - return \(%spec means %body) + return \($spec means $body) upgrade action "action" to "4.8.10" via (..) - for (%tree %end_version): - %spec = %tree.2 - %body = %tree.3 - if %body: - if %spec.type is: + for ($tree $end_version): + $spec = $tree.2 + $body = $tree.3 + if $body: + if $spec.type is: "List": - if ((size of %spec) == 1): - return \(externally %spec.1 means %body) + if ((size of $spec) == 1): + return \(externally $spec.1 means $body) ..else: - return \(externally %spec all mean %body) + return \(externally $spec all mean $body) else: - return \(externally %spec means %body) + return \(externally $spec means $body) ..else: - return \(%spec's meaning) + return \($spec's meaning) upgrade action "compile 1 to" to "4.8.10" via (..) - for (%tree %end_version): - %spec = %tree.2 - %body = %tree.4 - if %spec.type is: + for ($tree $end_version): + $spec = $tree.2 + $body = $tree.4 + if $spec.type is: "List": - if ((size of %spec) == 1): - return \(%spec.1 compiles to %body) + if ((size of $spec) == 1): + return \($spec.1 compiles to $body) ..else: - return \(%spec all compile to %body) + return \($spec all compile to $body) else: - return \(%spec compiles to %body) + return \($spec compiles to $body) upgrade action "parse 1 as" to "4.8.10" via (..) - for (%tree %end_version): - %spec = %tree.2 - %body = %tree.4 - if %spec.type is: + for ($tree $end_version): + $spec = $tree.2 + $body = $tree.4 + if $spec.type is: "List": - if ((size of %spec) == 1): - return \(%spec.1 parses as %body) + if ((size of $spec) == 1): + return \($spec.1 parses as $body) ..else: - return \(%spec all parse as %body) + return \($spec all parse as $body) else: - return \(%spec parse as %body) + return \($spec parse as $body) -upgrade action (compile as %) to "4.8.10" as (what % compiles to) -upgrade action (remove action %) to "4.8.10" as ((%'s meaning) = (nil)) +upgrade action (compile as $) to "4.8.10" as (what $ compiles to) +upgrade action (remove action $) to "4.8.10" as (($'s meaning) = (nil)) diff --git a/compatibility/4.9.nom b/compatibility/4.9.nom index acfbc29..26a20fb 100644 --- a/compatibility/4.9.nom +++ b/compatibility/4.9.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file defines upgrades from Nomsu <4.9 to 4.9 use "compatibility/compatibility.nom" @@ -6,6 +6,6 @@ use "compatibility/compatibility.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ upgrade action "if" to "4.9" via (..) - for (%tree %end_version): - if ((size of %tree) > 2): return %tree - return \(when %tree.2) + for ($tree $end_version): + if ((size of $tree) > 2): return $tree + return \(when $tree.2) diff --git a/compatibility/compatibility.nom b/compatibility/compatibility.nom index 3c8ee00..356a8e0 100644 --- a/compatibility/compatibility.nom +++ b/compatibility/compatibility.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V4.12.12.8 +#!/usr/bin/env nomsu -V5.12.12.8 # This file contains code for defining ways to upgrade code between different versions of Nomsu. @@ -7,114 +7,114 @@ use "lib/os.nom" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -%UPGRADES = {} -externally (upgrade to %version via %upgrade_fn) means: - %UPGRADES.%version = %upgrade_fn -%ACTION_UPGRADES = ({} with fallback % -> {}) -externally (upgrade action %stub to %version via %upgrade_fn) means: - %ACTION_UPGRADES.%version.%stub = %upgrade_fn +$UPGRADES = {} +externally (upgrade to $version via $upgrade_fn) means: + $UPGRADES.$version = $upgrade_fn +$ACTION_UPGRADES = ({} with fallback $ -> {}) +externally (upgrade action $stub to $version via $upgrade_fn) means: + $ACTION_UPGRADES.$version.$stub = $upgrade_fn -(upgrade %tree to %version as %body) parses as (..) - upgrade to %version via ((% %end_version) -> (% with %tree -> %body)) +(upgrade $tree to $version as $body) parses as (..) + upgrade to $version via (($ $end_version) -> ($ with $tree -> $body)) -(upgrade action %actions to %version as %body) compiles to: - if (%actions is "Action" syntax tree): - %actions = \[%actions] - %lua = (Lua "") - for %action in %actions: - %replacements = {} - for %i in 1 to (size of %action): - if (%action.%i is "Var" syntax tree): - %replacements.(%action.%i.1) = "\(\%tree as lua id)[\%i]" +(upgrade action $actions to $version as $body) compiles to: + if ($actions is "Action" syntax tree): + $actions = \[$actions] + $lua = (Lua "") + for $action in $actions: + $replacements = {} + for $i in 1 to (size of $action): + if ($action.$i is "Var" syntax tree): + $replacements.($action.$i.1) = "\(\$tree as lua id)[\$i]" define mangler - (make tree %t) means: + (make tree $t) means: when: - (%t is "Var" syntax tree): - if %replacements.(%t.1): - return %replacements.(%t.1) + ($t is "Var" syntax tree): + if $replacements.($t.1): + return $replacements.($t.1) ..else: - external %needs_mangle = (yes) - return "SyntaxTree{type=\(quote %t.type), source=\(quote "\(%t.source)"), \(quote (mangle %t.1))}" + external $needs_mangle = (yes) + return "SyntaxTree{type=\(quote $t.type), source=\(quote "\($t.source)"), \(quote (mangle $t.1))}" - (%t is syntax tree): - %args = [] - for %k = %v in %t: - if ((type of %k) == "number"): - %args::add (make tree %v) + ($t is syntax tree): + $args = [] + for $k = $v in $t: + if ((type of $k) == "number"): + $args|add (make tree $v) ..else: - %args::add "\(%k)=\(make tree %v)" - return "SyntaxTree{\(%args::joined with ", ")}" + $args|add "\($k)=\(make tree $v)" + return "SyntaxTree{\($args|joined with ", ")}" else: - return (quote %t) + return (quote $t) - unless ("\%lua" == ""): - %lua::add "\n" + unless ("\$lua" == ""): + $lua|add "\n" - %retval = (make tree %body) - %lua::add (..) - Lua "\ - ..upgrade_action_1_to_2_via(\(quote %action.stub), \(%version as lua expr), function(\(\%tree as lua id)) - return \%retval + $retval = (make tree $body) + $lua|add (..) + Lua " + upgrade_action_1_to_2_via(\(quote $action.stub), \($version as lua expr), function(\(\$tree as lua id)) + return \$retval end)" - return %lua + return $lua externally [..] - %tree upgraded from %start_version to %end_version - %tree upgraded to %end_version from %start_version + $tree upgraded from $start_version to $end_version + $tree upgraded to $end_version from $start_version ..all mean: - unless (%tree is syntax tree): return %tree - (%ver as list) means ((% as number) for % in %ver matching "[0-9]+") - %versions = {} - for %v = % in %UPGRADES: - %versions.%v = (yes) + unless ($tree is syntax tree): return $tree + ($ver as list) means (($ as number) for $ in $ver matching "[0-9]+") + $versions = {} + for $v = $ in $UPGRADES: + $versions.$v = (yes) - for %v = % in %ACTION_UPGRADES: - %versions.%v = (yes) + for $v = $ in $ACTION_UPGRADES: + $versions.$v = (yes) - %versions = ((keys in %versions) sorted by % -> (% as list)) - for %ver in %versions: - if ((%ver as list) <= (%start_version as list)): do next %ver - if ((%ver as list) > (%end_version as list)): stop %ver - if %ACTION_UPGRADES.%ver: - %tree = (..) - %tree with % ->: - if ((% is "Action" syntax tree) and %ACTION_UPGRADES.%ver.(%.stub)): - %with_upgraded_args = {..} - : for %k = %v in %: add %k = (%v upgraded from %start_version to %end_version) - set %with_upgraded_args's metatable to (%'s metatable) - return (%ACTION_UPGRADES.%ver.(%.stub) %with_upgraded_args %end_version) + $versions = ((keys in $versions) sorted by $ -> ($ as list)) + for $ver in $versions: + if (($ver as list) <= ($start_version as list)): do next $ver + if (($ver as list) > ($end_version as list)): stop $ver + if $ACTION_UPGRADES.$ver: + $tree = (..) + $tree with $ ->: + if (($ is "Action" syntax tree) and $ACTION_UPGRADES.$ver.($.stub)): + $with_upgraded_args = {..} + : for $k = $v in $: add $k = ($v upgraded from $start_version to $end_version) + set $with_upgraded_args's metatable to ($'s metatable) + return ($ACTION_UPGRADES.$ver.($.stub) $with_upgraded_args $end_version) - if %UPGRADES.%ver: - %with_upgraded_args = {..} + if $UPGRADES.$ver: + $with_upgraded_args = {..} : - for %k = %v in %tree: - add %k = (%v upgraded from %start_version to %end_version) - set %with_upgraded_args's metatable to (%tree's metatable) - %tree = (%UPGRADES.%ver %with_upgraded_args %end_version) + for $k = $v in $tree: + add $k = ($v upgraded from $start_version to $end_version) + set $with_upgraded_args's metatable to ($tree's metatable) + $tree = ($UPGRADES.$ver $with_upgraded_args $end_version) - if (%tree.version != %end_version): - %tree = (SyntaxTree {: for %k = %v in %tree: add %k = %v}) - %tree.version = %end_version - if %tree.shebang: - %tree.shebang = "#!/usr/bin/env nomsu -V\%end_version\n" + if ($tree.version != $end_version): + $tree = (SyntaxTree {: for $k = $v in $tree: add $k = $v}) + $tree.version = $end_version + if $tree.shebang: + $tree.shebang = "#!/usr/bin/env nomsu -V\$end_version\n" - return %tree + return $tree -externally (%tree upgraded from %start_version) means (..) - %tree upgraded from %start_version to (Nomsu version) +externally ($tree upgraded from $start_version) means (..) + $tree upgraded from $start_version to (Nomsu version) -externally (%tree upgraded to %end_version) means (..) - %tree upgraded from (%tree.version or (Nomsu version)) to %end_version +externally ($tree upgraded to $end_version) means (..) + $tree upgraded from ($tree.version or (Nomsu version)) to $end_version -externally (%tree upgraded) means (..) - %tree upgraded from (%tree.version or (Nomsu version)) to (Nomsu version) +externally ($tree upgraded) means (..) + $tree upgraded from ($tree.version or (Nomsu version)) to (Nomsu version) -externally (use %path from version %version) means: - for %filename in (files for %path): - if (=lua "LOADED[\%filename]"): - do next %filename - %file = (read file %filename) - %tree = (parse %file from %filename) - %tree = (upgrade %tree from %version) - run tree %tree +externally (use $path from version $version) means: + for $filename in (files for $path): + if (=lua "LOADED[\$filename]"): + do next $filename + $file = (read file $filename) + $tree = (parse $file from $filename) + $tree = (upgrade $tree from $version) + run tree $tree |
