From addac10a47693a976808bf75fe63aed19f8dbb63 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 22 Jul 2018 15:01:05 -0700 Subject: Re-autoformatted everything. The main changes are: no longer adding a newline after 1-line indented code inside blocks, and forcing files to have a trailing newline. The trailing newline thing created a lot of spurious changes. --- compatibility/2.4.nom | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'compatibility/2.4.nom') diff --git a/compatibility/2.4.nom b/compatibility/2.4.nom index 479d1d2..958c6bf 100644 --- a/compatibility/2.4.nom +++ b/compatibility/2.4.nom @@ -10,30 +10,23 @@ upgrade %tree to "2.4" as: %new_lines = [] %body = (..) (%tree.2 upgraded) if (%tree.2 is "Block" syntax tree) else [%tree.2 upgraded] - for %line in %body: if: (not (%line is syntax tree)): compile error at %tree.source "WUT: %s" - (not (%line is "Action" syntax tree)): add %line to %new_lines - (%line.stub is "* %"): add %line.2 to %conditions - (%line.stub == "* else %"): add (\(else %block) with vars {block:%line.3}) to %new_lines - (%line.stub != "* % %"): add %line to %new_lines - else: add %line.2 to %conditions %action = %line.3 unless (%action is "Block" syntax tree): %action = (=lua "Block(\%action.source, \%action)") - add %action to %conditions add (=lua "Action(\%conditions[1].source, unpack(\%conditions))") to %new_lines %conditions = [] @@ -46,31 +39,25 @@ upgrade %tree to "2.4" as: %new_lines = [] %body = (..) (%tree.5 upgraded) if (%tree.5 is "Block" syntax tree) else [%tree.5 upgraded] - for %line in %body: if: (not (%line is "Action" syntax tree)): add %line to %new_lines - (%line.stub is "* %"): add %line.2 to %values - (%line.stub == "* else %"): add (\(else %block) with vars {block:%line.3}) to %new_lines - (%line.stub != "* % %"): add %line to %new_lines - else: add %line.2 to %values %action = %line.3 unless (%action is "Block" syntax tree): %action = (=lua "Block(\%action.source, \%action)") - add %action to %values add (=lua "Action(\%values[1].source, unpack(\%values))") to %new_lines %values = [] return (..) \(if %var is %body) with vars {..} - var:%tree.2 upgraded, body:=lua "Block(\%tree[5].source, unpack(\%new_lines))" \ No newline at end of file + var:%tree.2 upgraded, body:=lua "Block(\%tree[5].source, unpack(\%new_lines))" -- cgit v1.2.3