diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-10 16:26:08 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-09-10 16:26:27 -0700 |
| commit | 7c6047254e5aa7ce5a0667b14676b22a7447f956 (patch) | |
| tree | f98478e6c77257610e43dc45447cd23e91bdaaae /compatibility/compatibility.nom | |
| parent | c859eac2beb20889e162ca28f889cc02ac592266 (diff) | |
Upgraded to 3.8 (text method changes) and fixed some bugs in
tree_to_nomsu.
Diffstat (limited to 'compatibility/compatibility.nom')
| -rw-r--r-- | compatibility/compatibility.nom | 14 |
1 files changed, 5 insertions, 9 deletions
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 |
