mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-22 20:40:29 +02:00
in meta-reader, return directly if the peeked char is EOF
* module/system/repl/repl.scm (meta-reader): If the (next-char #t) returns EOF, return that EOF directly, as it seems that with guile -q, the subsequent `read' actually waits for another C-d. Dunno why.
This commit is contained in:
parent
a56db0f67e
commit
abf780e45e
1 changed files with 9 additions and 3 deletions
|
@ -38,9 +38,15 @@
|
||||||
(with-input-from-port
|
(with-input-from-port
|
||||||
(if (pair? read-args) (car read-args) (current-input-port))
|
(if (pair? read-args) (car read-args) (current-input-port))
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(if (eqv? (next-char #t) #\,)
|
(let ((ch (next-char #t)))
|
||||||
(begin (read-char) meta-command-token)
|
(cond ((eof-object? ch)
|
||||||
(read))))))
|
;; apparently sometimes even if this is eof, read will
|
||||||
|
;; wait on somethingorother. strange.
|
||||||
|
ch)
|
||||||
|
((eqv? (char #\,))
|
||||||
|
(read-char)
|
||||||
|
meta-command-token)
|
||||||
|
(else (read))))))))
|
||||||
|
|
||||||
;; repl-reader is a function defined in boot-9.scm, and is replaced by
|
;; repl-reader is a function defined in boot-9.scm, and is replaced by
|
||||||
;; something else if readline has been activated. much of this hoopla is
|
;; something else if readline has been activated. much of this hoopla is
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue