add `var-ref->mod-decl-insp' and switch `cur-code-insp' uses

Macros and other tools that need syntax privilege used
`(current-code-inspector)' at the module top-level to try to
capture the right code inspector at load time. It's more
consistent to instead use the enclosing module's declaration-time
inspector, and `var-ref->mod-decl-insp' provides that. The
new function works only on references to anonymous variables,
which limits access to the inspector.

The real function name is longer, of course.

original commit: 0197902309c5400d463393829a88282c627dafd2
tokens
Matthew Flatt 13 years ago
parent fec8ddaed9
commit 6abcf2f87b

@ -28,7 +28,8 @@
((char-range-arg #'#\1 #'here) (char->integer #\1)) ((char-range-arg #'#\1 #'here) (char->integer #\1))
((char-range-arg #'"1" #'here) (char->integer #\1))) ((char-range-arg #'"1" #'here) (char->integer #\1)))
(define orig-insp (current-code-inspector)) (define orig-insp (variable-reference->module-declaration-inspector
(#%variable-reference)))
(define (disarm stx) (define (disarm stx)
(syntax-disarm stx orig-insp)) (syntax-disarm stx orig-insp))

Loading…
Cancel
Save