make @ be non-terminating in Scheme code, only in Scribble context (like |)
svn: r6780
This commit is contained in:
parent
2c9a1d8eca
commit
840b68963b
|
@ -448,18 +448,21 @@
|
||||||
;; readtables
|
;; readtables
|
||||||
|
|
||||||
(define at-readtable
|
(define at-readtable
|
||||||
(make-readtable #f ch:command 'terminating-macro (dispatcher #f)))
|
(make-readtable #f ch:command 'non-terminating-macro (dispatcher #f)))
|
||||||
|
|
||||||
(provide use-at-readtable)
|
(provide use-at-readtable)
|
||||||
(define (use-at-readtable)
|
(define (use-at-readtable)
|
||||||
(port-count-lines! (current-input-port))
|
(port-count-lines! (current-input-port))
|
||||||
(current-readtable at-readtable))
|
(current-readtable at-readtable))
|
||||||
|
|
||||||
;; similar to plain Scheme (scribble, actually), but with `|' as a
|
;; similar to plain Scheme (scribble, actually), but with `@' and `|' as
|
||||||
;; terminating macro (otherwise it behaves the same; the only difference is
|
;; terminating macro characters (otherwise it behaves the same; the only
|
||||||
;; that `a|b|c' is three symbols)
|
;; difference is that `a|b|c' is three symbols and `@foo@bar' are two
|
||||||
|
;; @-forms)
|
||||||
(define command-readtable
|
(define command-readtable
|
||||||
(make-readtable at-readtable #\| 'terminating-macro
|
(make-readtable at-readtable
|
||||||
|
ch:command 'terminating-macro (dispatcher #f)
|
||||||
|
#\| 'terminating-macro
|
||||||
(lambda (char inp source-name line-num col-num position)
|
(lambda (char inp source-name line-num col-num position)
|
||||||
(let ([m (*regexp-match #rx#"^([^|]*)\\|" inp)])
|
(let ([m (*regexp-match #rx#"^([^|]*)\\|" inp)])
|
||||||
(unless m
|
(unless m
|
||||||
|
|
Loading…
Reference in New Issue
Block a user