From 23b52bc22d9ec24702c1bed0f8ce90271eec6460 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 29 Aug 2018 15:02:36 -0700 Subject: Intermediate step in upgrading to 3.6. Fixed a bug with upgrading methods. --- compatibility/compatibility.nom | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'compatibility/compatibility.nom') diff --git a/compatibility/compatibility.nom b/compatibility/compatibility.nom index 86a5ac7..d74cabe 100644 --- a/compatibility/compatibility.nom +++ b/compatibility/compatibility.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.5.5.6 +#!/usr/bin/env nomsu -V3.6.5.6 # This file contains code for defining ways to upgrade code between different versions of Nomsu. @@ -33,20 +33,22 @@ compile [upgrade action %actions to %version as %body] to: return %replacements.(%t.1) ..else: return ".." - \(%t.type)(\(quote "\(%t.source)"), \(..) + \(%t.type){source=\(quote "\(%t.source)"), \(..) quote "\(%t.1) \000\(=lua "string.format('%X', __MANGLE_INDEX)")" - ..) + ..} (%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 ", "))" + add "source=\(\%tree as lua id).source" to %args at index 1 + if %t.target: + add "target=\(make tree %t.target)" to %args at index 1 + return "\(%t.type){\(%args joined with ", ")}" else: return (quote "\%t") - unless ("\%lua" == ""): to %lua write "\n" - to %lua write (..) + unless ("\%lua" == ""): %lua::append "\n" + %lua::append (..) Lua ".." A_upgrade_action_1_to_2_via_3(\(quote %action.stub), \(%version as lua expr), function(\(..) \%tree as lua id -- cgit v1.2.3