X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Freader.lisp;h=3ec10599c7f9623014002b964d73bacba4ad257a;hb=f8893c7c658bf9d9e0757c63e47af2fdea810f04;hp=34a35ab4aaf80eba3520a5821ccc08ea634d8945;hpb=12478433c6f18424c5d98f3075e3b832ad2c6ee3;p=sbcl.git diff --git a/src/code/reader.lisp b/src/code/reader.lisp index 34a35ab..3ec1059 100644 --- a/src/code/reader.lisp +++ b/src/code/reader.lisp @@ -316,7 +316,7 @@ (defvar *ouch-ptr*) (declaim (type index *read-buffer-length* *inch-ptr* *ouch-ptr*)) -(declaim (simple-string *read-buffer*)) +(declaim (type (simple-array character (*)) *read-buffer*)) (defmacro reset-read-buffer () ;; Turn *READ-BUFFER* into an empty read buffer. @@ -1431,7 +1431,7 @@ `(error 'simple-parse-error :format-control ,format-control :format-arguments (list string)))) - (with-array-data ((string string) + (with-array-data ((string string :offset-var offset) (start start) (end (%check-vector-sequence-bounds string start end))) (let ((index (do ((i start (1+ i))) @@ -1460,10 +1460,10 @@ found-digit t)) (junk-allowed (return nil)) ((whitespacep char) - (do ((jndex (1+ index) (1+ jndex))) - ((= jndex end)) - (declare (fixnum jndex)) - (unless (whitespacep (char string jndex)) + (loop + (incf index) + (when (= index end) (return)) + (unless (whitespacep (char string index)) (parse-error "junk in string ~S"))) (return nil)) (t @@ -1475,7 +1475,7 @@ (if junk-allowed nil (parse-error "no digits in string ~S"))) - index))))) + (- index offset)))))) ;;;; reader initialization code