From 104f22c9f850aad400128bc9454166cd0fe0184f Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Sun, 5 May 2013 07:54:43 -0500 Subject: [PATCH] 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 --- collects/drracket/private/syncheck/traversals.rkt | 8 ++++++-- collects/scribblings/tools/tools.scrbl | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/collects/drracket/private/syncheck/traversals.rkt b/collects/drracket/private/syncheck/traversals.rkt index 63cf5b8bf0..98a167e900 100644 --- a/collects/drracket/private/syncheck/traversals.rkt +++ b/collects/drracket/private/syncheck/traversals.rkt @@ -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))) diff --git a/collects/scribblings/tools/tools.scrbl b/collects/scribblings/tools/tools.scrbl index 08eda37fc0..66e932c07e 100644 --- a/collects/scribblings/tools/tools.scrbl +++ b/collects/scribblings/tools/tools.scrbl @@ -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