Ignore:
Timestamp:
Apr 5, 2009, 5:42:53 PM (10 years ago)
Author:
gz
Message:

Record source locations when loading source files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-files.lisp

    r11859 r11901  
    13221322(defun load-from-stream (stream print &aux (eof-val (list ())) val)
    13231323  (with-compilation-unit (:override nil) ; try this for included files
    1324     (let ((env (new-lexical-environment (new-definition-environment 'eval))))
     1324    (let ((env (new-lexical-environment (new-definition-environment 'eval)))
     1325          ;; source note map to use with any compilations.
     1326          (*nx-source-note-map*  (and *save-source-locations*
     1327                                      (make-hash-table :test #'eq :shared nil)))
     1328          (*loading-toplevel-location* nil))
    13251329      (%rplacd (defenv.type (lexenv.parent-env env)) *outstanding-deferred-warnings*)
    1326       (while (neq eof-val (setq val (read stream nil eof-val)))
     1330      (loop
     1331        (multiple-value-setq (val *loading-toplevel-location*)
     1332          (read-recording-source stream
     1333                                 :eofval eof-val
     1334                                 :file-name *loading-file-source-file*
     1335                                 :map *nx-source-note-map*
     1336                                 :save-source-text (neq *save-source-locations* :no-text)))
     1337        (when (eq eof-val val)
     1338          (return))
    13271339        (when (eq print :source) (format t "~&Source: ~S~%" val))
    13281340        (setq val (cheap-eval-in-environment val env))
Note: See TracChangeset for help on using the changeset viewer.