adjust scribble's racketblock renderer so that #true and #false
don't turn into #t and #f.
This commit is contained in:
parent
4990029922
commit
c8d476c76e
|
@ -209,12 +209,19 @@
|
|||
(memq (syntax-e c) (current-variable-list)))]
|
||||
[(s it? sub?)
|
||||
(let ([sc (syntax-e c)])
|
||||
(let ([s (or (syntax-property c 'display-string)
|
||||
(format "~s" (if (literal-syntax? sc)
|
||||
(literal-syntax-stx sc)
|
||||
(if (var-id? sc)
|
||||
(var-id-sym sc)
|
||||
sc))))])
|
||||
(let ([s (cond
|
||||
[(syntax-property c 'display-string) => values]
|
||||
[(literal-syntax? sc) (format "~s" (literal-syntax-stx sc))]
|
||||
[(var-id? sc) (format "~s" (var-id-sym sc))]
|
||||
[(eq? sc #t)
|
||||
(if (equal? (syntax-span c) 5)
|
||||
"#true"
|
||||
"#t")]
|
||||
[(eq? sc #f)
|
||||
(if (equal? (syntax-span c) 6)
|
||||
"#false"
|
||||
"#f")]
|
||||
[else (format "~s" sc)])])
|
||||
(if (and (symbol? sc)
|
||||
((string-length s) . > . 1)
|
||||
(char=? (string-ref s 0) #\_)
|
||||
|
|
13
collects/tests/scribble/docs/read-alts.scrbl
Normal file
13
collects/tests/scribble/docs/read-alts.scrbl
Normal file
|
@ -0,0 +1,13 @@
|
|||
#lang scribble/manual
|
||||
@(require scribble/manual)
|
||||
@; test that various alternatives in reader syntax get
|
||||
@; turned into the right things when rendered
|
||||
@racketblock[#t
|
||||
#true
|
||||
#f
|
||||
#false
|
||||
(a . < . b)
|
||||
(< a b)
|
||||
"abcdef"
|
||||
([{}])]
|
||||
|
8
collects/tests/scribble/docs/read-alts.txt
Normal file
8
collects/tests/scribble/docs/read-alts.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
#t
|
||||
#true
|
||||
#f
|
||||
#false
|
||||
(a . < . b)
|
||||
(< a b)
|
||||
"abcdef"
|
||||
([{}])
|
Loading…
Reference in New Issue
Block a user