Fix 'read-sh' to default to current input port
* geesh/parser.scm (read-sh): Make the 'port' argument optional and default to using 'current-input-port'.
This commit is contained in:
parent
aabfd76beb
commit
3ec520596c
|
@ -776,10 +776,11 @@ bracket."
|
||||||
((? eof-object?) #f)
|
((? eof-object?) #f)
|
||||||
(code code))))))
|
(code code))))))
|
||||||
|
|
||||||
(define (read-sh port)
|
(define* (read-sh #:optional (port #f))
|
||||||
"Read a complete Shell command from @var{port} (or the current input
|
"Read a complete Shell command from @var{port} (or the current input
|
||||||
port if @var{port} is unspecified)."
|
port if @var{port} is unspecified)."
|
||||||
(let* ((stop? #f)
|
(let* ((port (or port (current-output-port)))
|
||||||
|
(stop? #f)
|
||||||
(stop! (lambda () (set! stop? #t)))
|
(stop! (lambda () (set! stop? #t)))
|
||||||
(pre-lex (make-lexer port read-sh/bracketed read-sh/backquoted))
|
(pre-lex (make-lexer port read-sh/bracketed read-sh/backquoted))
|
||||||
(lex (lambda () (if stop? '*eoi* (pre-lex))))
|
(lex (lambda () (if stop? '*eoi* (pre-lex))))
|
||||||
|
|
Loading…
Reference in New Issue