fixed detection of multiple objects after . in list
authorAndrea Griffini <agriff@tin.it>
Sat, 4 May 2013 08:07:02 +0000 (10:07 +0200)
committerAndrea Griffini <agriff@tin.it>
Sat, 4 May 2013 08:07:02 +0000 (10:07 +0200)
src/read.lisp

index 05074a4..d5a0c65 100644 (file)
                         (discard-char stream #\.)
                         (if (terminalp (%peek-char stream))
                             (prog1 (ls-read stream) ; Dotted pair notation
-                              (discard-char stream #\)))
+                              (skip-whitespaces-and-comments stream)
+                              (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)))))