From e665d9725c4bb02f4c18d16527367f424cb880fa Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 20 Mar 2019 15:55:57 -0700 Subject: Auto-updated to 7.0.0 syntax and removed some shims. --- lib/compatibility/2.nom | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lib/compatibility/2.nom') diff --git a/lib/compatibility/2.nom b/lib/compatibility/2.nom index 782ccb0..2deeca2 100644 --- a/lib/compatibility/2.nom +++ b/lib/compatibility/2.nom @@ -1,5 +1,6 @@ -#!/usr/bin/env nomsu -V6.15.13.8 -# +#!/usr/bin/env nomsu -V7.0.0 + +### This file defines upgrades from Nomsu 1 to Nomsu 2 use "compatibility/compatibility" @@ -11,15 +12,13 @@ upgrade $tree to "2" as: if ($tree.stub == "if 1 2 else"): $true_body = ($tree.3 upgraded) unless ($true_body is "Block" syntax tree): - $true_body = \(: $true_body) + $true_body = ("Block" tree with $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 - } + "Action" tree with "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" @@ -34,4 +33,4 @@ upgrade $tree to "2" as: unless (($bits, last) is "Block" syntax tree): $body = ($bits, last) $bits.(#$bits) = (=lua "SyntaxTree{type='Block', source=\$body.source, \$body}") - return (=lua "SyntaxTree{type='Action', source=\$tree.source, unpack(\$bits)}") \ No newline at end of file + return (=lua "SyntaxTree{type='Action', source=\$tree.source, unpack(\$bits)}") -- cgit v1.2.3