diff --git a/drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt b/drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt index 2c1448f78..1920f5f4a 100644 --- a/drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt +++ b/drracket-tool-text-lib/drracket/private/syncheck/traversals.rkt @@ -1563,24 +1563,25 @@ ;; add-id : id-set identifier -> void (define (add-id mapping id level-of-enclosing-module #:mods [mods dont-add-binder+mods]) (when (original-enough? id) - (define shifted-id (syntax-shift-phase-level id level-of-enclosing-module)) - (define old (free-id-table-ref mapping shifted-id '())) - (define no-span-id - (if (syntax-property shifted-id 'implicit-made-explicit) - (datum->syntax shifted-id - (syntax-e shifted-id) - (vector (syntax-source shifted-id) - (syntax-line shifted-id) - (syntax-column shifted-id) - (syntax-position shifted-id) - 0) - shifted-id) - shifted-id)) - (define with-binder+mods - (if (equal? mods dont-add-binder+mods) - no-span-id - (binder+mods no-span-id mods))) - (free-id-table-set! mapping shifted-id (cons with-binder+mods old)))) + (unless (syntax-property id 'identifier-as-keyword) + (define shifted-id (syntax-shift-phase-level id level-of-enclosing-module)) + (define old (free-id-table-ref mapping shifted-id '())) + (define no-span-id + (if (syntax-property shifted-id 'implicit-made-explicit) + (datum->syntax shifted-id + (syntax-e shifted-id) + (vector (syntax-source shifted-id) + (syntax-line shifted-id) + (syntax-column shifted-id) + (syntax-position shifted-id) + 0) + shifted-id) + shifted-id)) + (define with-binder+mods + (if (equal? mods dont-add-binder+mods) + no-span-id + (binder+mods no-span-id mods))) + (free-id-table-set! mapping shifted-id (cons with-binder+mods old))))) (define (original-enough? x) (or (syntax-original? x) diff --git a/drracket-tool-text-lib/info.rkt b/drracket-tool-text-lib/info.rkt index 0e0e70e3e..776bdfa52 100644 --- a/drracket-tool-text-lib/info.rkt +++ b/drracket-tool-text-lib/info.rkt @@ -13,7 +13,7 @@ (define pkg-authors '(robby)) -(define version "1.4") +(define version "1.5") (define license '(Apache-2.0 OR MIT)) diff --git a/drracket/scribblings/tools/tools.scrbl b/drracket/scribblings/tools/tools.scrbl index b717dad24..217e00720 100644 --- a/drracket/scribblings/tools/tools.scrbl +++ b/drracket/scribblings/tools/tools.scrbl @@ -573,11 +573,14 @@ Check Syntax collects the values of the @indexed-racket['disappeared-use], @indexed-racket['disappeared-binding], @indexed-racket['identifiers-as-disappeared-uses?], +@indexed-racket['identifer-as-keyword], @indexed-racket['sub-range-binders], and @indexed-racket['mouse-over-tooltips] and uses them to add -additional arrows to the program text. These properties are +control which arrows are added to the program text. These properties are intended for use when a macro discards or manufactures identifiers that, -from the programmers perspective, should be binding each other. +from the programmers perspective, should be binding each other, or when +there are identifiers that are intended to be used more in the spirit of keywords, +and thus should be ignored. For example, here is program with a macro that discards its arguments, but adds properties to the result syntax object so that the two occurrences of @racket[_a] @@ -821,9 +824,15 @@ For example, here's a macro that shows the span of itself in a tooltip on mouseo (char-span (+ 1 2))} +If the syntax property @racket['identifier-as-keyword] is any value +except @racket[#f] and appears on an identifier, then Check Syntax +ignores the identifier, not drawing any arrows to it. + @history[#:changed "1.3" @list{ Looks for @racket['sub-range-binders] - on binding identifiers (not just in expression positions).}] + on binding identifiers (not just in expression positions).} + #:changed "1.5" @list{ + Looks for @racket['identifier-as-keyword] on identifiers.}] @section{Cooperating with Background Check Syntax} @section-index["online-check-syntax logger"]