relax check syntax's syntax-original? requirement

Allow macro writers to put an 'original-for-check-syntax
property on identifiers and, if it is there, don't
insist on syntax-original? holding, just draw arrows anyway
This commit is contained in:
Robby Findler 2013-05-05 07:54:43 -05:00
parent 158997cde7
commit 104f22c9f8
2 changed files with 10 additions and 2 deletions

View File

@ -1248,19 +1248,23 @@
;; add-init-exp : id-set identifier stx -> void
(define (add-init-exp mapping id init-exp)
(when (syntax-original? id)
(when (original-enough? id)
(let* ([old (free-identifier-mapping-get mapping id (λ () '()))]
[new (cons init-exp old)])
(free-identifier-mapping-put! mapping id new))))
;; add-id : id-set identifier -> void
(define (add-id mapping id level-of-enclosing-module)
(when (syntax-original? id)
(when (original-enough? id)
(let* ([id (syntax-shift-phase-level id level-of-enclosing-module)]
[old (free-identifier-mapping-get mapping id (λ () '()))]
[new (cons id old)])
(free-identifier-mapping-put! mapping id new))))
(define (original-enough? x)
(or (syntax-original? x)
(syntax-property x 'original-for-check-syntax)))
;; get-idss : id-set -> (listof (listof identifier))
(define (get-idss mapping)
(free-identifier-mapping-map mapping (λ (x y) y)))

View File

@ -942,6 +942,10 @@ are treated as a binding/bound pair by Check Syntax.
See also @racket[current-recorded-disappeared-uses].
Check Syntax only draws arrows between identifiers that are @racket[syntax-original?]
or that have the @racket[syntax-property] @racket['original-for-check-syntax]
set to @racket[#t].
@section{Teaching Languages}
The teaching language are implemented via the tools interface and thus