[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

07/08: bournish: Handle EOF in the reader.

From: Ludovic Courtès
Subject: 07/08: bournish: Handle EOF in the reader.
Date: Mon, 6 Jun 2016 16:15:12 +0000 (UTC)

civodul pushed a commit to branch master
in repository guix.

commit 8bebe00a76012a07e91930dcfd68058d4309ae99
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 6 18:06:58 2016 +0200

    bournish: Handle EOF in the reader.
    * guix/build/bournish.scm (read-bournish): Add case for EOF.
 guix/build/bournish.scm |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/build/bournish.scm b/guix/build/bournish.scm
index 4022796..3bea1c8 100644
--- a/guix/build/bournish.scm
+++ b/guix/build/bournish.scm
@@ -134,8 +134,10 @@ commands such as 'ls' and 'cd'; it lacks globbing, 
 (define (read-bournish port env)
   "Read a Bournish expression from PORT, and return the corresponding Scheme
 code as an sexp."
-  (match (string-tokenize (read-line port))
-    ((command args ...)
+  (match (read-line port)
+    ((? eof-object? eof)
+     eof)
+    ((= string-tokenize (command args ...))
      (match (assoc command %commands)
        ((command proc)                            ;built-in command
         (apply proc (map expand-variable args)))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]