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/2.3.nom | 2 +- compatibility/2.4.nom | 2 +- compatibility/2.5.5.5.nom | 2 +- compatibility/2.5.nom | 2 +- compatibility/2.nom | 2 +- compatibility/3.5.5.6.nom | 2 +- compatibility/3.6.nom | 2 +- compatibility/3.7.nom | 2 +- compatibility/3.nom | 2 +- compatibility/compatibility.nom | 14 +++++--------- 10 files changed, 14 insertions(+), 18 deletions(-) (limited to 'compatibility') diff --git a/compatibility/2.3.nom b/compatibility/2.3.nom index 4df7850..2381010 100644 --- a/compatibility/2.3.nom +++ b/compatibility/2.3.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <2.3 to Nomsu 2.3 diff --git a/compatibility/2.4.nom b/compatibility/2.4.nom index 741b7eb..b50fec3 100644 --- a/compatibility/2.4.nom +++ b/compatibility/2.4.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <2.4 to Nomsu 2.4 diff --git a/compatibility/2.5.5.5.nom b/compatibility/2.5.5.5.nom index b086a9d..b242e57 100644 --- a/compatibility/2.5.5.5.nom +++ b/compatibility/2.5.5.5.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <2.5.5.5 to Nomsu 2.5.5.5 diff --git a/compatibility/2.5.nom b/compatibility/2.5.nom index 27473e7..e55915d 100644 --- a/compatibility/2.5.nom +++ b/compatibility/2.5.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <2.5 to Nomsu 2.5 diff --git a/compatibility/2.nom b/compatibility/2.nom index 06e3bff..3f37cb4 100644 --- a/compatibility/2.nom +++ b/compatibility/2.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu 1 to Nomsu 2 diff --git a/compatibility/3.5.5.6.nom b/compatibility/3.5.5.6.nom index 892725f..b46144e 100644 --- a/compatibility/3.5.5.6.nom +++ b/compatibility/3.5.5.6.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <3.5.5.6 to Nomsu 3.5.5.6 diff --git a/compatibility/3.6.nom b/compatibility/3.6.nom index c6afc75..07ad7a5 100644 --- a/compatibility/3.6.nom +++ b/compatibility/3.6.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <3.6 to 3.6 diff --git a/compatibility/3.7.nom b/compatibility/3.7.nom index dda2b5a..ca49e3f 100644 --- a/compatibility/3.7.nom +++ b/compatibility/3.7.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <3.7 to 3.7 diff --git a/compatibility/3.nom b/compatibility/3.nom index d1599cc..8f20f1a 100644 --- a/compatibility/3.nom +++ b/compatibility/3.nom @@ -1,4 +1,4 @@ -#!/usr/bin/env nomsu -V3.7.5.6 +#!/usr/bin/env nomsu -V3.8.7.6 # This file defines upgrades from Nomsu <=2 to Nomsu 3 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