From: Andrea Griffini Date: Sat, 4 May 2013 08:22:59 +0000 (+0200) Subject: better error reporting for (1 . 2 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=e3fc975fff2fa7c0b56e70ae611350f30f3a8ea0;p=jscl.git better error reporting for (1 . 2 --- diff --git a/src/read.lisp b/src/read.lisp index 0cfe563..83f1af8 100644 --- a/src/read.lisp +++ b/src/read.lisp @@ -119,9 +119,10 @@ (if (terminalp (%peek-char stream)) (prog1 (ls-read stream) ; Dotted pair notation (skip-whitespaces-and-comments stream) - (if (char= (%peek-char stream) #\) ) - (discard-char stream #\)) - (error "More than one object follows . in list"))) + (let ((ch (%peek-char stream))) + (if (or (null ch) (char= #\) ch)) + (discard-char stream #\)) + (error "Multiple objects following . in a list")))) (let ((token (concat "." (read-escaped-until stream #'terminalp)))) (cons (interpret-token token) (%read-list stream)))))