From bf67a610135c0803187cf6ed896638962f142d14 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 18 Jul 2018 17:55:29 -0700 Subject: Updating to version 2.4.4.3, with new syntax for multi-statement 'if' and switch statements. --- compatibility/compatibility.nom | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compatibility/compatibility.nom') diff --git a/compatibility/compatibility.nom b/compatibility/compatibility.nom index 9482e32..c5ac55f 100644 --- a/compatibility/compatibility.nom +++ b/compatibility/compatibility.nom @@ -21,16 +21,16 @@ compile [upgrade action %action to %version as %body] to: %replacements.(%action.%i.1) = "\(\%tree as lua id)[\%i]" local action [make tree %t]: when: - * (%t is "Var" syntax tree): + (%t is "Var" syntax tree): if (%replacements.(%t.1)): return %replacements.(%t.1) ..else: return "\(%t.type)(\(quote "\(%t.source)"), \(quote "\(%t.1) \0\(=lua "string.format('%X', __MANGLE_INDEX)")"))" - * (%t is syntax tree): + (%t is syntax tree): %args = ((make tree %) for % in %t) add "\(\%tree as lua id).source" to %args at index 1 return "\(%t.type)(\(%args joined with ", "))" - *else: return (quote "\%t") + else: return (quote "\%t") return (..) Lua ".." A_upgrade_action_1_to_2_via_3(\(quote %action.stub), \(%version as lua expr), function(\(\%tree as lua id)) @@ -66,9 +66,9 @@ parse [%tree upgraded from %start_version] as (..) %tree upgraded from %start_version to (Nomsu version) parse [%tree upgraded to %end_version] as (..) - %tree upgraded from %tree.version to %end_version + %tree upgraded from (%tree.version or "0") to %end_version -parse [%tree upgraded] as (%tree upgraded from %tree.version to (Nomsu version)) +parse [%tree upgraded] as (%tree upgraded from (%tree.version or "0") to (Nomsu version)) action [use %path from version %version] (..) for file %filename in %path: if (=lua "LOADED[\%filename]"): do next %filename -- cgit v1.2.3