bournish: Handle EOF in the reader.

* guix/build/bournish.scm (read-bournish): Add case for EOF.
This commit is contained in:
Ludovic Courtès 2016-06-06 18:06:58 +02:00
parent febf7ef675
commit 8bebe00a76
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -134,8 +134,10 @@ (define %commands
(define (read-bournish port env) (define (read-bournish port env)
"Read a Bournish expression from PORT, and return the corresponding Scheme "Read a Bournish expression from PORT, and return the corresponding Scheme
code as an sexp." code as an sexp."
(match (string-tokenize (read-line port)) (match (read-line port)
((command args ...) ((? eof-object? eof)
eof)
((= string-tokenize (command args ...))
(match (assoc command %commands) (match (assoc command %commands)
((command proc) ;built-in command ((command proc) ;built-in command
(apply proc (map expand-variable args))) (apply proc (map expand-variable args)))