unstable, syntax/parse: fix phase-of-enclosing-module

Was broken because with begin-for-syntax, offset no longer limited
to 0 or 1. But now varrefs give module base phase directly.
This commit is contained in:
Ryan Culpepper 2011-09-12 19:01:44 -06:00
parent 095b5a5131
commit 350c8214f8

View File

@ -85,11 +85,6 @@
(explode-module-path-index y) (explode-module-path-index y)
(list y))))) (list y)))))
(define-syntax (phase-of-enclosing-module stx) (define-syntax-rule (phase-of-enclosing-module)
(syntax-case stx () (variable-reference->module-base-phase
[(poem) (#%variable-reference)))
(let ([phase-within-module (syntax-local-phase-level)])
#`(let ([phase-of-this-expression
(variable-reference->phase (#%variable-reference))])
(- phase-of-this-expression
#,(if (zero? phase-within-module) 0 1))))]))