Changeset 5992


Ignore:
Timestamp:
Mar 7, 2007, 6:21:16 AM (18 years ago)
Author:
Gary Byers
Message:

Bind *FCOMP-PREVIOUS-POSITION* in FCOMP-READ-LOOP (e.g., don't just hammer
on the static binding.)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/lib/nfcomp.lisp

    r5927 r5992  
    374374  (namestring path))
    375375
    376 ; orig-file is back-translated when from fcomp-file
    377 ; when from fcomp-include it's included filename merged with *compiling-file*
    378 ; which is not back translated
     376;;; orig-file is back-translated when from fcomp-file
     377;;; when from fcomp-include it's included filename merged with *compiling-file*
     378;;; which is not back translated
    379379(defun fcomp-read-loop (filename orig-file env processing-mode)
    380380  (when *compile-verbose*
     
    394394           form)
    395395      (declare (special *fasl-eof-forms* *fcomp-toplevel-forms* *fasl-source-file*))
    396       ;This should really be something like `(set-loading-source ,filename)
    397       ;but then couldn't compile level-1 with this...
    398  ;-> In any case, change this to be a fasl opcode, so don't make an lfun just
    399  ;   to do this...
    400 ; There are other reasons - more compelling ones than "fear of tiny lfuns" -
    401 ; for making this a fasl opcode.
     396      ;;This should really be something like `(set-loading-source
     397      ;;,filename) but then couldn't compile level-1 with this...  ->
     398      ;;In any case, change this to be a fasl opcode, so don't make an
     399      ;;lfun just to do this...  There are other reasons - more
     400      ;;compelling ones than "fear of tiny lfuns" - for making this a
     401      ;;fasl opcode.
    402402      (fcomp-output-form $fasl-src env *loading-file-source-file*)
    403       (loop
    404         (let* ((*fcomp-stream-position* (file-position stream)))
    405           (unless (eq read-package *package*)
    406             (fcomp-compile-toplevel-forms env)
    407             (setq read-package *package*))
    408           (let ((*reading-for-cfasl*
    409                  (and *fcomp-load-time* cfasl-load-time-eval-sym)))
    410             (declare (special *reading-for-cfasl*))
    411             (let ((pos (file-position stream)))
    412               (handler-bind
    413                   ((error #'(lambda (c) ; we should distinguish read errors from others?
    414                               (format *error-output* "~&Read error between positions ~a and ~a in ~a." pos (file-position stream) filename)
    415                               (signal c))))
    416                 (setq form (read stream nil eofval)))))
    417           (when (eq eofval form) (return))
    418           (fcomp-form form env processing-mode)
    419           (setq *fcomp-previous-position* *fcomp-stream-position*)))
     403      (let* ((*fcomp-previous-position* nil))
     404        (loop
     405          (let* ((*fcomp-stream-position* (file-position stream)))
     406            (unless (eq read-package *package*)
     407              (fcomp-compile-toplevel-forms env)
     408              (setq read-package *package*))
     409            (let ((*reading-for-cfasl*
     410                   (and *fcomp-load-time* cfasl-load-time-eval-sym)))
     411              (declare (special *reading-for-cfasl*))
     412              (let ((pos (file-position stream)))
     413                (handler-bind
     414                    ((error #'(lambda (c) ; we should distinguish read errors from others?
     415                                (format *error-output* "~&Read error between positions ~a and ~a in ~a." pos (file-position stream) filename)
     416                                (signal c))))
     417                  (setq form (read stream nil eofval)))))
     418            (when (eq eofval form) (return))
     419            (fcomp-form form env processing-mode)
     420            (setq *fcomp-previous-position* *fcomp-stream-position*))))
    420421      (while (setq form *fasl-eof-forms*)
    421422        (setq *fasl-eof-forms* nil)
Note: See TracChangeset for help on using the changeset viewer.