X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Ftarget-stream.lisp;h=3144550bfb3c77722b3eff05389e7bb9ad250eba;hb=3fe0010d2777b41e01ea9b4a0f894cfa40f7df1b;hp=9593cd2dbfd06896496f484057208c4828f16d26;hpb=2155320d81ccfe78cb8e6ba349883b2a0a366353;p=sbcl.git diff --git a/src/code/target-stream.lisp b/src/code/target-stream.lisp index 9593cd2..3144550 100644 --- a/src/code/target-stream.lisp +++ b/src/code/target-stream.lisp @@ -27,32 +27,32 @@ ;;; EOF-DETECTED-FORM - the form to execute when EOF has been detected ;;; (this will default to EOF-RESULT) (sb!xc:defmacro generalized-peeking-mechanism - (peek-type eof-result char-var read-form eof-value unread-form + (peek-type eof-value char-var read-form read-eof unread-form &optional (skipped-char-form nil) (eof-detected-form nil)) `(let ((,char-var ,read-form)) - (cond ((eql ,char-var ,eof-value) + (cond ((eql ,char-var ,read-eof) ,(if eof-detected-form eof-detected-form - eof-result)) + eof-value)) ((characterp ,peek-type) (do ((,char-var ,char-var ,read-form)) - ((or (eql ,char-var ,eof-value) + ((or (eql ,char-var ,read-eof) (char= ,char-var ,peek-type)) - (cond ((eql ,char-var ,eof-value) + (cond ((eql ,char-var ,read-eof) ,(if eof-detected-form eof-detected-form - eof-result)) + eof-value)) (t ,unread-form ,char-var))) ,skipped-char-form)) ((eql ,peek-type t) (do ((,char-var ,char-var ,read-form)) - ((or (eql ,char-var ,eof-value) + ((or (eql ,char-var ,read-eof) (not (whitespacep ,char-var))) - (cond ((eql ,char-var ,eof-value) + (cond ((eql ,char-var ,read-eof) ,(if eof-detected-form eof-detected-form - eof-result)) + eof-value)) (t ,unread-form ,char-var))) ,skipped-char-form))