In Scheme mode @|| will also throw an error instead of being read as a
comment. This is to avoid confusing situations like (define foo (list x '@|| y)) which quoted the `y' since @|| was read as a comment. svn: r15789
This commit is contained in:
parent
7d69ec01c2
commit
1ea8c66511
|
@ -391,10 +391,12 @@
|
||||||
(let*-values ([(line col pos) (port-next-location inp)]
|
(let*-values ([(line col pos) (port-next-location inp)]
|
||||||
[(xs) (get)])
|
[(xs) (get)])
|
||||||
(cond [(not xs) xs]
|
(cond [(not xs) xs]
|
||||||
[(null? xs) (make-special-comment #f)]
|
[(or (null? xs) (not (null? (cdr xs))))
|
||||||
[(null? (cdr xs)) (car xs)]
|
(read-error line col pos
|
||||||
[else (read-error line col pos
|
"a ~a|...| form in Scheme mode must have ~a"
|
||||||
"too many escape expressions")]))
|
ch:command
|
||||||
|
"exactly one escaped expression")]
|
||||||
|
[else (car xs)]))
|
||||||
(get))))
|
(get))))
|
||||||
|
|
||||||
;; called only when we must see a command in the input
|
;; called only when we must see a command in the input
|
||||||
|
|
|
@ -636,6 +636,22 @@ bar}
|
||||||
---
|
---
|
||||||
\foo{\" -\error-> #rx":1:6: read: expected a closing '\"'$"
|
\foo{\" -\error-> #rx":1:6: read: expected a closing '\"'$"
|
||||||
---
|
---
|
||||||
|
@|1 2|
|
||||||
|
-@error->
|
||||||
|
#rx"a @|...| form in Scheme mode must have exactly one escaped expression"
|
||||||
|
---
|
||||||
|
@||
|
||||||
|
-@error->
|
||||||
|
#rx"a @|...| form in Scheme mode must have exactly one escaped expression"
|
||||||
|
---
|
||||||
|
\|1 2|
|
||||||
|
-\error->
|
||||||
|
#rx"a \\\\|...| form in Scheme mode must have exactly one escaped expression"
|
||||||
|
---
|
||||||
|
\||
|
||||||
|
-\error->
|
||||||
|
#rx"a \\\\|...| form in Scheme mode must have exactly one escaped expression"
|
||||||
|
---
|
||||||
;; -------------------- inside-reader
|
;; -------------------- inside-reader
|
||||||
---
|
---
|
||||||
foo bar baz -@i-> "foo bar baz"
|
foo bar baz -@i-> "foo bar baz"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user