From 7c6047254e5aa7ce5a0667b14676b22a7447f956 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 10 Sep 2018 16:26:08 -0700 Subject: Upgraded to 3.8 (text method changes) and fixed some bugs in tree_to_nomsu. --- compatibility/compatibility.nom | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'compatibility/compatibility.nom') diff --git a/compatibility/compatibility.nom b/compatibility/compatibility.nom index 7f186ea..2093aff 100644 --- a/compatibility/compatibility.nom +++ b/compatibility/compatibility.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file contains code for defining ways to upgrade code between different versions of Nomsu. @@ -26,7 +26,7 @@ compile [upgrade action %actions to %version as %body] to: if (%action.%i.type is "Var"): %replacements.(%action.%i.1) = "\(\%tree as lua id)[\%i]" - %needs_mangle = (no) + define mangler local action [make tree %t]: when: (%t is "Var" syntax tree): @@ -34,10 +34,7 @@ compile [upgrade action %actions to %version as %body] to: return %replacements.(%t.1) ..else: external %needs_mangle = (yes) - return ".." - \(%t.type){source=\(quote "\(%t.source)"), \(..) - quote "\(%t.1) \000\(=lua "string.format('%X', __MANGLE_INDEX)")" - ..} + return "\(%t.type){source=\(quote "\(%t.source)"), \(quote (mangle %t.1))}" (%t is syntax tree): %args = [] @@ -47,7 +44,7 @@ compile [upgrade action %actions to %version as %body] to: ..else: %args::add "\(%k)=\(make tree %v)" - return "\(%t.type){\(%args joined with ", ")}" + return "\(%t.type){\(%args::joined with ", ")}" else: return (quote %t) @@ -58,8 +55,7 @@ compile [upgrade action %actions to %version as %body] to: upgrade_action_1_to_2_via_3(\(quote %action.stub), \(%version as lua expr), function(\(..) \%tree as lua id ..) - \("__MANGLE_INDEX = (__MANGLE_INDEX or 0) + 1\n " if (%needs_mangle) else "")\ - ..return \%retval + return \%retval end) return %lua -- cgit v1.2.3