macro-stepper: yet another local-expansion fix
svn: r17668 original commit: 6eb51f94020ddaad0e0e907d98a5f741f06012e5
This commit is contained in:
parent
9fb6db9c14
commit
82aed89fa4
|
@ -336,10 +336,18 @@
|
|||
(k f v s ws)))]
|
||||
|
||||
[(R** f v p s ws [#:new-local-context clause ...] . more)
|
||||
;; Note: pass no left-state to subclauses,
|
||||
;; then discard result state, restore s when return.
|
||||
#'(RSbind (with-new-local-context v (R** f v p #f ws clause ...))
|
||||
(lambda (f2 v2 s2 ws2) (R** f2 v2 p s ws2 . more)))]
|
||||
;; If vis = #t, then (clause ...) do not affect local config
|
||||
;; If vis = #f, then proceed normally
|
||||
;; *except* must save & restore real term
|
||||
#'(let* ([vis (visibility)]
|
||||
[process-clauses (lambda () (R** #f (if vis #f v) _ #f ws clause ...))])
|
||||
(RSbind (if vis
|
||||
(with-new-local-context v (process-clauses))
|
||||
(process-clauses))
|
||||
(lambda (f2 v2 s2 ws2)
|
||||
(let ([v2 (if vis v v2)]
|
||||
[s2 (if vis s s2)])
|
||||
(R** f v2 p s2 ws2 . more)))))]
|
||||
|
||||
;; Subterm handling
|
||||
[(R** f v p s ws [reducer hole fill] . more)
|
||||
|
|
|
@ -360,16 +360,13 @@
|
|||
(R)]
|
||||
[(cons local rest)
|
||||
(R [#:pattern ?form]
|
||||
[#:if (visibility)
|
||||
;; If macro with local-expand is transparent,
|
||||
;; then all local-expansions must be transparent.
|
||||
([#:parameterize ((macro-policy (lambda _ #t)))
|
||||
[#:new-local-context
|
||||
[LocalAction ?form local]]])
|
||||
([#:pass1]
|
||||
;; Use ?disconnected; do not modify real term
|
||||
[LocalAction ?disconnected local]
|
||||
[#:pass2])]
|
||||
[#:parameterize ((macro-policy
|
||||
;; If macro with local-expand is transparent,
|
||||
;; then all local-expansions must be transparent.
|
||||
(if (visibility) (lambda _ #t) (macro-policy))))
|
||||
[#:new-local-context
|
||||
[#:pattern ?form]
|
||||
[LocalAction ?form local]]]
|
||||
[LocalActions ?form rest])]))
|
||||
|
||||
(define (LocalAction local)
|
||||
|
|
Loading…
Reference in New Issue
Block a user