From 520acd39795766354fc44c6e15f5f33f255ca33a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Jan 2019 21:33:02 -0800 Subject: Overhauling OO-API a little to make it more minimalistic. --- lib/compatibility/2.4.nom | 4 ++-- lib/compatibility/2.nom | 2 +- lib/compatibility/6.15.nom | 8 +++++++- 3 files changed, 10 insertions(+), 4 deletions(-) (limited to 'lib/compatibility') diff --git a/lib/compatibility/2.4.nom b/lib/compatibility/2.4.nom index a904dd0..953307b 100644 --- a/lib/compatibility/2.4.nom +++ b/lib/compatibility/2.4.nom @@ -21,7 +21,7 @@ upgrade $tree to "2.4" as: (not ($line is "Action" syntax tree)): $new_lines, add $line - ($line.stub is "*"): + ($line.stub == "*"): if ((size of $line) == 2): $conditions, add $line.2 ..else: @@ -59,7 +59,7 @@ upgrade $tree to "2.4" as: (not ($line is "Action" syntax tree)): $new_lines, add $line - ($line.stub is "*"): + ($line.stub == "*"): if ((size of $line) == 2): $values, add $line.2 ..else: diff --git a/lib/compatibility/2.nom b/lib/compatibility/2.nom index ca3cb6a..0b17082 100644 --- a/lib/compatibility/2.nom +++ b/lib/compatibility/2.nom @@ -29,7 +29,7 @@ upgrade $tree to "2" as: ] for $n in $need_blocks: - if ($tree.stub is $n): + if ($tree.stub == $n): $bits = [: for $ in $tree: add (($ upgraded) if ($ is syntax tree) else $)] unless (($bits, last) is "Block" syntax tree): $body = ($bits, last) diff --git a/lib/compatibility/6.15.nom b/lib/compatibility/6.15.nom index 72d625d..ed892c1 100644 --- a/lib/compatibility/6.15.nom +++ b/lib/compatibility/6.15.nom @@ -13,7 +13,7 @@ upgrade action (externally $x all mean $y) to "6.15" as upgrade action ($lists flattened) to "6.15" as [ : for $ in recursive $lists: - if ($ is a "List"): + if ($ is "a List"): for $child in $: recurse $ on $child ..else: add $ @@ -24,3 +24,9 @@ upgrade action (compile error at $pos $msg $hint) to "6.15" as Compile error: \$msg Hint: \$hint ") + +upgrade action ($x is $y) to "6.15" as ($x == $y) +upgrade action [$a isn't $b, $a is not $b, $a not= $b] to "6.15" as ($a != $b) +upgrade action [$a is a $b, $a is an $b] to "6.15" as ($a is $b) +upgrade action [$a isn't a $b, $a isn't an $b, $a is not a $b, $a is not an $b] +..to "6.15" as ($a isn't $b) -- cgit v1.2.3