diff --git a/collects/scribble/private/manual-scheme.rkt b/collects/scribble/private/manual-scheme.rkt index fed6472a..f09686e5 100644 --- a/collects/scribble/private/manual-scheme.rkt +++ b/collects/scribble/private/manual-scheme.rkt @@ -122,7 +122,11 @@ (make-element symbol-color (list (to-element/no-color s)))) (define-syntax (keep-s-expr stx) - (syntax-case stx () + (syntax-case stx (quote) + [(_ ctx '#t #(src line col pos 5)) + #'(make-long-boolean #t)] + [(_ ctx '#f #(src line col pos 6)) + #'(make-long-boolean #f)] [(_ ctx s srcloc) (let ([sv (syntax-e (syntax-case #'s (quote) @@ -134,10 +138,10 @@ (identifier? (car sv)) (or (free-identifier=? #'cons (car sv)) (free-identifier=? #'list (car sv))))) - ;; We know that the context is irrelvant - #'s - ;; Context may be relevant: - #'(*keep-s-expr s ctx)))])) + ;; We know that the context is irrelvant + #'s + ;; Context may be relevant: + #'(*keep-s-expr s ctx)))])) (define (*keep-s-expr s ctx) (if (symbol? s) (make-just-context s ctx) diff --git a/collects/scribble/racket.rkt b/collects/scribble/racket.rkt index bcbabb18..321eb718 100644 --- a/collects/scribble/racket.rkt +++ b/collects/scribble/racket.rkt @@ -46,6 +46,7 @@ (struct-out var-id) (struct-out shaped-parens) + (struct-out long-boolean) (struct-out just-context) (struct-out alternate-display) (struct-out literal-syntax) @@ -1010,6 +1011,7 @@ (define-struct var-id (sym)) (define-struct shaped-parens (val shape)) + (define-struct long-boolean (val)) (define-struct just-context (val ctx)) (define-struct alternate-display (id string)) (define-struct literal-syntax (stx)) @@ -1069,6 +1071,10 @@ (syntax-property (do-syntax-ize (shaped-parens-val v) col line ht #f qq #f) 'paren-shape (shaped-parens-shape v))] + [(long-boolean? v) + (datum->syntax #f + (and (long-boolean-val v) #t) + (vector #f line col (+ 1 col) (if (long-boolean-val v) 5 6)))] [(just-context? v) (let ([s (do-syntax-ize (just-context-val v) col line ht #f qq #f)]) (datum->syntax (just-context-ctx v) diff --git a/collects/scribblings/scribble/scheme.scrbl b/collects/scribblings/scribble/scheme.scrbl index 5a89221c..4500c6af 100644 --- a/collects/scribblings/scribble/scheme.scrbl +++ b/collects/scribblings/scribble/scheme.scrbl @@ -126,6 +126,13 @@ When @racket[to-paragraph] and variants encounter a that has a @racket['paren-shape] property with value @racket[shape].} +@defstruct[long-boolean ([val boolean?])]{ + +When @racket[to-paragraph] and variants encounter a +@racket[long-boolean] structure, it is typeset as @racket[#true] or @racket[#false], +as opposed to @racket[#t] or @racket[#f].} + + @defstruct[just-context ([val any/c] [context syntax?])]{