diff options
Diffstat (limited to 'lib/compatibility')
| -rw-r--r-- | lib/compatibility/2.4.nom | 14 | ||||
| -rw-r--r-- | lib/compatibility/2.nom | 3 | ||||
| -rw-r--r-- | lib/compatibility/4.8.10.nom | 28 | ||||
| -rw-r--r-- | lib/compatibility/4.9.nom | 2 | ||||
| -rw-r--r-- | lib/compatibility/5.13.nom | 4 | ||||
| -rw-r--r-- | lib/compatibility/6.14.nom | 4 | ||||
| -rw-r--r-- | lib/compatibility/compatibility.nom | 2 |
7 files changed, 28 insertions, 29 deletions
diff --git a/lib/compatibility/2.4.nom b/lib/compatibility/2.4.nom index 17a2df5..b28893a 100644 --- a/lib/compatibility/2.4.nom +++ b/lib/compatibility/2.4.nom @@ -30,7 +30,7 @@ upgrade $tree to "2.4" as: $new_lines, add $line ($line.stub == "* else"): - $new_lines, add ("Action" tree with "else" $line.3) + $new_lines, add (else `$line.3) else: $conditions, add $line.2 @@ -44,9 +44,7 @@ upgrade $tree to "2.4" as: ") $conditions = [] - return - "Action" tree with "when" - "Block" tree from $tree.2.source with (unpack $new_lines) + return `(when `("Block" tree from $tree.2.source with (unpack $new_lines))) "if 1 is ?" "if 1 = ?": $values = [] @@ -66,7 +64,7 @@ upgrade $tree to "2.4" as: $new_lines, add $line ($line.stub == "* else"): - $new_lines, add ("Action" tree with "else" $line.3) + $new_lines, add (else `$line.3) else: $values, add $line.2 @@ -79,5 +77,7 @@ upgrade $tree to "2.4" as: $values = [] return - "Action" tree with "if" ($tree.2 upgraded) "is" - "Block" tree from $tree.5.source with (unpack $new_lines) + `( + if `($tree.2 upgraded) is + `("Block" tree from $tree.5.source with (unpack $new_lines)) + ) diff --git a/lib/compatibility/2.nom b/lib/compatibility/2.nom index 2deeca2..4dc867d 100644 --- a/lib/compatibility/2.nom +++ b/lib/compatibility/2.nom @@ -17,8 +17,7 @@ upgrade $tree to "2" as: unless ($false_body is "Block" syntax tree): $false_body = (=lua "Block(\$false_body.source, \$false_body)") - return - "Action" tree with "if" ($tree.2 upgraded) $true_body "else" $false_body + return `(if `($tree.2 upgraded) `$true_body else `$false_body) $need_blocks = [ "if", "unless", "for 1 in", "for 1 = 2 in", "repeat while 1", "repeat 1 times" diff --git a/lib/compatibility/4.8.10.nom b/lib/compatibility/4.8.10.nom index 3ec7421..ee60a61 100644 --- a/lib/compatibility/4.8.10.nom +++ b/lib/compatibility/4.8.10.nom @@ -13,12 +13,12 @@ upgrade action "local action" to "4.8.10" via if $spec.type is: "List": if (#$spec == 1): - return ("Action" tree with $spec.1 "means" $body) + return `(`$spec.1 means `$body) ..else: - return ("Action" tree with $spec "all" "mean" $body) + return `(`$spec all mean `$body) else: - return ("Action" tree with $spec "means" $body) + return `(`$spec means `$body) upgrade action "action" to "4.8.10" via for ($tree $end_version): @@ -28,14 +28,14 @@ upgrade action "action" to "4.8.10" via if $spec.type is: "List": if (#$spec == 1): - return ("Action" tree with "externally" $spec.1 "means" $body) + return `(externally `$spec.1 means `$body) ..else: - return ("Action" tree with "externally" $spec "all" "mean" $body) + return `(externally `$spec all mean `$body) else: - return ("Action" tree with "externally" $spec "means" $body) + return `(externally `$spec means `$body) ..else: - return ("Action" tree with $spec "'" "s" "meaning") + return `((`$spec)'s meaning) upgrade action "compile 1 to" to "4.8.10" via for ($tree $end_version): @@ -44,12 +44,12 @@ upgrade action "compile 1 to" to "4.8.10" via if $spec.type is: "List": if (#$spec == 1): - return ("Action" tree with $spec.1 "compiles" "to" $body) + return `(`$spec.1 compiles to `$body) ..else: - return ("Action" tree with $spec "all" "compile" "to" $body) + return `(`$spec all compile to `$body) else: - return ("Action" tree with $spec "compiles" "to" $body) + return `(`$spec compiles to `$body) upgrade action "parse 1 as" to "4.8.10" via for ($tree $end_version): @@ -58,12 +58,12 @@ upgrade action "parse 1 as" to "4.8.10" via if $spec.type is: "List": if (#$spec == 1): - return ("Action" tree with $spec.1 "parses" "as" $body) + return `(`$spec.1 parses as `$body) ..else: - return ("Action" tree with $spec "all" "parse" "as" $body) + return `(`$spec all parse as `$body) else: - return ("Action" tree with $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))
\ No newline at end of file +upgrade action (remove action $) to "4.8.10" as (($'s meaning) = (nil)) diff --git a/lib/compatibility/4.9.nom b/lib/compatibility/4.9.nom index 9371f8c..ddb6b9f 100644 --- a/lib/compatibility/4.9.nom +++ b/lib/compatibility/4.9.nom @@ -10,4 +10,4 @@ upgrade action "if" to "4.9" via for ($tree $end_version): if (#$tree > 2): return $tree - return ("Action" tree with "when" $tree.2)
\ No newline at end of file + return `(when `$tree.2) diff --git a/lib/compatibility/5.13.nom b/lib/compatibility/5.13.nom index c2ab90e..3073fdf 100644 --- a/lib/compatibility/5.13.nom +++ b/lib/compatibility/5.13.nom @@ -17,6 +17,6 @@ upgrade action "with" to "5.13" via when: (($a.type == "DictEntry") and (#$a == 1)): $a = $a.1 (all of [$a.type == "DictEntry", #$a == 2]): - $a = ("Action" tree with $a.1 "=" $a.2) + $a = `(`$a.1 = `$a.2) $new_assignments.$i = $a - return ("Action" tree with "with" $new_assignments $body) + return `(with `$new_assignments `$body) diff --git a/lib/compatibility/6.14.nom b/lib/compatibility/6.14.nom index b809afd..0d6b8de 100644 --- a/lib/compatibility/6.14.nom +++ b/lib/compatibility/6.14.nom @@ -28,7 +28,7 @@ upgrade action (assume $assumption or barf $err) to "6.14" as unless $assumption: fail $err upgrade action (barf $msg) to "6.14" as (fail $msg) -upgrade action ("Action" tree with 1 "'" "s" "meaning").stub to "6.14" via +upgrade action (`(1's meaning)).stub to "6.14" via $tree -> ("Var" tree from $tree.source with $tree.1) upgrade action (log base $b of $n) to "6.14" as (log $n base $b) upgrade action "use" to "6.14" via @@ -36,4 +36,4 @@ upgrade action "use" to "6.14" via $path = $tree.2.1 $path = ($path, with "%.nom$" -> "") $path = ($path, with "^lib/" -> "") - return ("Action" tree with "use" ("Text" tree from $tree.2.source with $path))
\ No newline at end of file + return `(use `("Text" tree from $tree.2.source with $path)) diff --git a/lib/compatibility/compatibility.nom b/lib/compatibility/compatibility.nom index 5ae261f..83eb3cd 100644 --- a/lib/compatibility/compatibility.nom +++ b/lib/compatibility/compatibility.nom @@ -22,7 +22,7 @@ external: (upgrade action $actions to $version as $body) compiles to: if ($actions is "Action" syntax tree): - $actions = ("List" tree with $actions) + $actions = `[`$actions] $lua = (Lua "") for $action in $actions: $replacements = {} |
