io: fix printing of '||
This commit is contained in:
parent
13e2817a2d
commit
f85d18aed6
|
@ -60,6 +60,7 @@
|
||||||
(ptest "#\\x" #\x)
|
(ptest "#\\x" #\x)
|
||||||
(ptest "'apple" 'apple)
|
(ptest "'apple" 'apple)
|
||||||
(ptest "'|apple banana|" '|apple banana|)
|
(ptest "'|apple banana|" '|apple banana|)
|
||||||
|
(ptest "'||" '||)
|
||||||
(ptest "'#:apple" '#:apple)
|
(ptest "'#:apple" '#:apple)
|
||||||
(ptest "\"apple\"" "apple")
|
(ptest "\"apple\"" "apple")
|
||||||
(ptest "#\"apple\"" #"apple")
|
(ptest "#\"apple\"" #"apple")
|
||||||
|
|
|
@ -56,12 +56,19 @@
|
||||||
(cond
|
(cond
|
||||||
[(or for-keyword?
|
[(or for-keyword?
|
||||||
for-type?
|
for-type?
|
||||||
(not (string->number? str)))
|
(and (not (string->number? str))
|
||||||
|
(not (string=? str ""))))
|
||||||
str]
|
str]
|
||||||
;; Remaining two cases add some form of quoting to
|
;; Remaining two cases add some form of quoting to
|
||||||
;; protect against a symbol looking like a number
|
;; protect against a symbol looking like a number
|
||||||
[(and config (not (config-get config read-accept-bar-quote)))
|
[(and config (not (config-get config read-accept-bar-quote)))
|
||||||
(string-append "\\" str)]
|
(cond
|
||||||
|
[(string=? str "")
|
||||||
|
;; There's no good answer in this case. Traditionally, Racket
|
||||||
|
;; just prints an empty string, anyway.
|
||||||
|
str]
|
||||||
|
[else
|
||||||
|
(string-append "\\" str)])]
|
||||||
[else
|
[else
|
||||||
(string-append "|" str "|")])]
|
(string-append "|" str "|")])]
|
||||||
[(or (and config (not (config-get config read-accept-bar-quote)))
|
[(or (and config (not (config-get config read-accept-bar-quote)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user