From e3fc975fff2fa7c0b56e70ae611350f30f3a8ea0 Mon Sep 17 00:00:00 2001 From: Andrea Griffini Date: Sat, 4 May 2013 10:22:59 +0200 Subject: [PATCH] better error reporting for (1 . 2 --- src/read.lisp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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))))) -- 1.7.10.4