diff options
-rw-r--r-- | mu.arc | 3 | ||||
-rw-r--r-- | mu.arc.t | 11 |
2 files changed, 13 insertions, 1 deletions
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 |