From 7946c901c7903596b216472f9cdbe9ae381027c7 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 30 Oct 2014 18:45:44 -0700 Subject: 184 --- mu.arc | 3 ++- mu.arc.t | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mu.arc b/mu.arc index 723925c6..cbe6940d 100644 --- a/mu.arc +++ b/mu.arc @@ -673,7 +673,8 @@ (unless (or (in ty.arg 'literal 'offset) (offset v.arg) (~isa v.arg 'sym) - (in v.arg 'nil 'default-scope)) + (in v.arg 'nil 'default-scope) + (pos 'global metadata.arg)) (= (offset v.arg) idx))) ;; literate tangling system for reordering code diff --git a/mu.arc.t b/mu.arc.t index 57e806d9..eb226398 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -1457,4 +1457,15 @@ (~is 23 (memory* (+ before 1)))) (prn "F - default-scope skipped for locations with metadata 'global'"))) +(reset) +(new-trace "convert-names-global") +(if (~iso (convert-names + '(((x integer) <- copy (4 literal)) + ((y integer global) <- copy (2 literal)) + ((default-scope integer) <- add (x integer) (y integer global)))) + '(((1 integer) <- copy (4 literal)) + ((y integer global) <- copy (2 literal)) + ((default-scope integer) <- add (1 integer) (y integer global)))) + (prn "F - convert-names never renames global operands")) + (reset) ; end file with this to persist the trace for the final test -- cgit 1.4.1-2-gfad0