* Changed parsing for #:escape-id to use a peeking-input-port.
pkgs/scribble-pkgs/scribble-lib/scribble/comment-reader.rkt original commit: c77affa143c4739ff140e2df69aac38aee1fffb3
This commit is contained in:
parent
bebefaa45c
commit
a93ee701fd
|
@ -1,4 +1,5 @@
|
||||||
(module comment-reader scheme/base
|
(module comment-reader scheme/base
|
||||||
|
(require (only-in racket/port peeking-input-port))
|
||||||
|
|
||||||
(provide (rename-out [*read read]
|
(provide (rename-out [*read read]
|
||||||
[*read-syntax read-syntax])
|
[*read-syntax read-syntax])
|
||||||
|
@ -17,12 +18,10 @@
|
||||||
(read-syntax/recursive src port)))
|
(read-syntax/recursive src port)))
|
||||||
|
|
||||||
(define (read-unsyntaxer port)
|
(define (read-unsyntaxer port)
|
||||||
(let-values ([(l c p) (port-next-location port)])
|
(let ([p (peeking-input-port port)])
|
||||||
(if (eq? (read port) '#:escape-id)
|
(if (eq? (read p) '#:escape-id)
|
||||||
(read port)
|
(begin (read port) (read port))
|
||||||
(begin
|
'unsyntax)))
|
||||||
(set-port-next-location! port l c p)
|
|
||||||
'unsyntax))))
|
|
||||||
|
|
||||||
(define (make-comment-readtable #:readtable [rt (current-readtable)])
|
(define (make-comment-readtable #:readtable [rt (current-readtable)])
|
||||||
(make-readtable rt
|
(make-readtable rt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user