(99 lines)
1 #!/usr/bin/env nomsu -V7.0.02 ###3 This file defines upgrades from Nomsu <4.11 to Nomsu 4.114 (overhaul of function literals, deleting (if all of ...), etc. shorthand)6 use "compatibility/compatibility"8 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~10 ### Overhaul of function literals:11 upgrade action "call 1 with" to "4.11" via12 for $tree:13 $tree2 = {.type = "Action", .source = $tree.source, .1 = $tree.2}14 for ($i = $arg) in $tree.4:15 $tree2.($i + 1) = $arg16 return (SyntaxTree $tree2)18 upgrade action ->$yield_value to "4.11" as (yield $yield_value)20 ### Replace set {$x:1, $y:2} with [$x, $y] = [1, 2]21 upgrade action "set" to "4.11" via22 for $tree:23 [$lhs, $rhs] = [\[], \[]]24 $lhs.source = $tree.2.source25 $rhs.source = $tree.2.source26 for ($i = $entry) in $tree.2:27 $lhs.$i = $entry.128 $rhs.$i = $entry.229 return ("Action" tree from $tree.source with $lhs "=" $rhs)31 upgrade action "1 with 2 ~>" to "4.11" via32 for $tree:33 at $tree fail ("34 Upgrade error: This method has been deprecated.35 Hint: Perhaps this could be use ($tree, map ...) instead.36 ")38 ### Changing filesystem API:39 upgrade action (for file $f in $path $body) to "4.11" as40 for $f in (files for $path) $body42 upgrade action ($expr for file $f in $path) to "4.11" as43 [: for $f in (files for $path): add $expr]45 upgrade action (line $n in $text) to "4.11" as ($text, line $n)46 upgrade action (line number of $pos in $text) to "4.11" as47 $text, line number at $pos49 ### Deduplicating goto labels:50 upgrade action [=== $label ===, *** $label ***] to "4.11" as (--- $label ---)51 upgrade action [===stop $label ===, ***stop $label ***] to "4.11" as52 ---stop $label ---54 upgrade action [===next $label ===, ***next $label ***] to "4.11" as55 ---next $label ---57 ### Deprecating shorthand functions:58 upgrade action [if all of $items $body, if all of $items then $body] to "4.11" as59 if (all of $items) $body61 upgrade action [unless all of $items $body, unless all of $items then $body] to62 .."4.11" as (if (not (all of $items)) $body)64 upgrade action [if any of $items $body, if any of $items then $body] to "4.11" as65 if (any of $items) $body67 upgrade action [unless any of $items $body, unless any of $items then $body] to68 .."4.11" as (if (not (any of $items)) $body)70 upgrade action [if none of $items $body, if none of $items then $body] to "4.11"71 ..as (if (not (any of $items)) $body)73 upgrade action [unless none of $items $body, unless none of $items then $body] to74 .."4.11" as (if (any of $items) $body)76 upgrade action [77 if all of $items $body else $else, if all of $items then $body else $else78 ] to "4.11" as (if (all of $items) $body else $else)80 upgrade action [81 unless all of $items $body else $else, unless all of $items then $body else $else82 ] to "4.11" as (if (not (all of $items)) $body else $else)84 upgrade action [85 if any of $items $body else $else, if any of $items then $body else $else86 ] to "4.11" as (if (any of $items) $body else $else)88 upgrade action [89 unless any of $items $body else $else, unless any of $items then $body else $else90 ] to "4.11" as (if (not (any of $items)) $body else $else)92 upgrade action [93 if none of $items $body else $else, if none of $items then $body else $else94 ] to "4.11" as (if (not (any of $items)) $body else $else)96 upgrade action [97 unless none of $items $body else $else98 unless none of $items then $body else $else99 ] to "4.11" as (if (any of $items) $body else $else)