aboutsummaryrefslogtreecommitdiff
path: root/compatibility/2.4.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-11 15:05:18 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-11 15:05:56 -0800
commit9a75d25c843b03e3671b71384fd48deb0607db43 (patch)
tree8baf212544a15fde2150fe790b4414d608a55663 /compatibility/2.4.nom
parent65ec3f597f0f39e01fa44a14ea4971c797a015c2 (diff)
Lots of fixes to the upgrading and codegen/autoformatting pipeline, also
deleted nomnom files, since they're mostly not needed anymore.
Diffstat (limited to 'compatibility/2.4.nom')
-rw-r--r--compatibility/2.4.nom16
1 files changed, 9 insertions, 7 deletions
diff --git a/compatibility/2.4.nom b/compatibility/2.4.nom
index 1f87a98..2b39dd5 100644
--- a/compatibility/2.4.nom
+++ b/compatibility/2.4.nom
@@ -9,7 +9,9 @@ use "compatibility/compatibility.nom"
upgrade %tree to "2.4" as:
unless (%tree is "Action" syntax tree): return
if %tree.stub is:
- "when":
+ "when" "if":
+ if ((size of %tree) == 3):
+ return %tree
%conditions = []
%new_lines = []
%body = (..)
@@ -29,15 +31,15 @@ upgrade %tree to "2.4" as:
%conditions::add %line.2
%action = %line.3
unless (%action is "Block" syntax tree):
- %action = (=lua "Block(\%action.source, \%action)")
+ %action = (=lua "SyntaxTree{type='Block', source=\%action.source, \%action}")
%conditions::add %action
- %new_lines::add (=lua "Action(\%conditions[1].source, unpack(\%conditions))")
+ %new_lines::add (=lua "SyntaxTree{type='Action', source=\%conditions[1].source, unpack(\%conditions)}")
%conditions = []
return (..)
- \(when %body) with vars {body:=lua "Block(\%tree[2].source, unpack(\%new_lines))"}
+ \(when %body) with vars {body:=lua "SyntaxTree{type='Block', source=\%tree[2].source, unpack(\%new_lines)}"}
- "when 1 is ?" "when 1 = ?":
+ "if 1 is ?" "if 1 = ?":
%values = []
%new_lines = []
%body = (..)
@@ -59,9 +61,9 @@ upgrade %tree to "2.4" as:
unless (%action is "Block" syntax tree):
%action = \(: %action)
%values::add %action
- %new_lines::add (=lua "Action(\%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 "Block(\%tree[5].source, unpack(\%new_lines))"
+ var:%tree.2 upgraded, body:=lua "SyntaxTree{type='Block', source=\%tree[5].source, unpack(\%new_lines)}"