aboutsummaryrefslogtreecommitdiff
path: root/compatibility
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-12-30 23:58:47 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-12-30 23:58:47 -0800
commit5059c081ac624ede925d5256885509ddd17181c6 (patch)
tree0457d135e5193126bf73466bfaae09df94ab8a7d /compatibility
parentec69ee6f62016a2edcc13e3183cbe4cadd75717f (diff)
Auto-upgraded code.
Diffstat (limited to 'compatibility')
-rw-r--r--compatibility/2.4.nom15
-rw-r--r--compatibility/2.5.5.5.nom4
-rw-r--r--compatibility/3.6.nom4
-rw-r--r--compatibility/3.7.nom9
-rw-r--r--compatibility/3.nom2
-rw-r--r--compatibility/4.10.12.7.nom50
-rw-r--r--compatibility/4.11.nom12
-rw-r--r--compatibility/4.12.nom4
-rw-r--r--compatibility/compatibility.nom7
9 files changed, 51 insertions, 56 deletions
diff --git a/compatibility/2.4.nom b/compatibility/2.4.nom
index 1279968..40b363a 100644
--- a/compatibility/2.4.nom
+++ b/compatibility/2.4.nom
@@ -37,12 +37,15 @@ upgrade $tree to "2.4" as:
$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)}"
+ =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)}")
+ .body =
+ =lua "SyntaxTree{type='Block', source=\$tree[2].source, unpack(\$new_lines)}"
}
"if 1 is ?" "if 1 = ?":
@@ -70,11 +73,13 @@ upgrade $tree to "2.4" as:
$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)}")
+ $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)}")
+ .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 05bf705..a8ec2bc 100644
--- a/compatibility/2.5.5.5.nom
+++ b/compatibility/2.5.5.5.nom
@@ -7,7 +7,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)"
+ =lua ("
+ \(base64 decode (hash $)):gsub('.', function(c) return ('%x02'):format(c) end)
+ ")
upgrade action [file with hash $] to "2.5.5.5" as
file with hash
diff --git a/compatibility/3.6.nom b/compatibility/3.6.nom
index 8fb52b5..eb19e39 100644
--- a/compatibility/3.6.nom
+++ b/compatibility/3.6.nom
@@ -18,10 +18,8 @@ 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)
-
+ $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
diff --git a/compatibility/3.7.nom b/compatibility/3.7.nom
index e81b9dc..052337c 100644
--- a/compatibility/3.7.nom
+++ b/compatibility/3.7.nom
@@ -7,19 +7,18 @@ use "compatibility/compatibility.nom"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
upgrade action [$index st to last in $list] to "3.7" as
-..($list, $index st to last)
+ $list, $index st to last
upgrade action [$index nd to last in $list] to "3.7" as
-..($list, $index nd to last)
+ $list, $index nd to last
upgrade action [$index rd to last in $list] to "3.7" as
-..($list, $index rd to last)
+ $list, $index rd to last
upgrade action [$index th to last in $list] to "3.7" as
-..($list, $index rd th last)
+ $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)
diff --git a/compatibility/3.nom b/compatibility/3.nom
index 6086bd0..cba6f71 100644
--- a/compatibility/3.nom
+++ b/compatibility/3.nom
@@ -12,4 +12,4 @@ 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 ...)"
+ "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 228fee9..1c0231c 100644
--- a/compatibility/4.10.12.7.nom
+++ b/compatibility/4.10.12.7.nom
@@ -12,41 +12,32 @@ upgrade action ($ as lua return) to "4.10.12.7" as
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 $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
@@ -84,9 +75,8 @@ upgrade $tree to "4.10.12.7" as:
$chunk2.($j - $i + 1) = $first_chunk.$j
$new_tree =
- SyntaxTree {
- .source = $tree.source, .type = "FileChunks", .1 = $chunk1, .2 = $chunk2
- }
+ SyntaxTree
+ {.source = $tree.source, .type = "FileChunks", .1 = $chunk1, .2 = $chunk2}
for $i in 2 to (size of $tree):
$new_tree.($i + 1) = $tree.$i
diff --git a/compatibility/4.11.nom b/compatibility/4.11.nom
index 8f6aacc..082825d 100644
--- a/compatibility/4.11.nom
+++ b/compatibility/4.11.nom
@@ -27,22 +27,20 @@ upgrade action "set" to "4.11" via
$rhs.$i = $entry.2
return
- SyntaxTree {
- .type = "Action", .source = $tree.source, .1 = $lhs, .2 = "=", .3 = $rhs
- }
+ 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."
+ "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 ($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
diff --git a/compatibility/4.12.nom b/compatibility/4.12.nom
index 8ab69ae..816acaa 100644
--- a/compatibility/4.12.nom
+++ b/compatibility/4.12.nom
@@ -10,9 +10,9 @@ 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."
+ "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."
+ "Use either (stop) or (go to (label)) instead."
diff --git a/compatibility/compatibility.nom b/compatibility/compatibility.nom
index bc34c4f..a83011f 100644
--- a/compatibility/compatibility.nom
+++ b/compatibility/compatibility.nom
@@ -34,7 +34,9 @@ externally (upgrade action $stub to $version via $upgrade_fn) means:
return $replacements.($t.1)
..else:
external $needs_mangle = (yes)
- return "SyntaxTree{type=\(quote $t.type), source=\(quote "\($t.source)"), \(quote (mangle $t.1))}"
+ return ("
+ SyntaxTree{type=\(quote $t.type), source=\(quote "\($t.source)"), \(quote (mangle $t.1))}
+ ")
($t is syntax tree):
$args = []
@@ -54,7 +56,8 @@ externally (upgrade action $stub to $version via $upgrade_fn) means:
$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))
+ upgrade_action_1_to_2_via(\(quote $action.stub), \($version as lua expr), function(\
+ ..\(\$tree as lua id))
return \$retval
end)
")