(unless truep (setf truename (truename pathname)))
(define-module (pathname :location location :truename truename)
(with-open-file (f-stream pathname :direction :input)
- (let* ((*readtable* (copy-readtable))
- (*package* (find-package '#:sod-user))
- (char-scanner (make-instance 'charbuf-scanner
+ (let* ((char-scanner (make-instance 'charbuf-scanner
:stream f-stream
:filename (namestring pathname)))
(scanner (make-instance 'sod-token-scanner
(declare (ignore consumedp))
(unless winp (syntax-error scanner result)))))))))
-(define-pluggable-parser module test (scanner pset)
- ;; `demo' string `;'
- (declare (ignore pset))
- (with-parser-context (token-scanner-context :scanner scanner)
- (parse (seq ("demo" (string (must :string)) (nil (must #\;)))
- (format t ";; DEMO ~S~%" string)))))
-
(define-pluggable-parser module file (scanner pset)
;; `import' string `;'
;; `load' string `;'
:truename true)))
(when module
(module-import module)
+ (pushnew path (module-files *module*))
(pushnew module
(module-dependencies
*module*))))
(common name "LISP" "Lisp file"
(lambda (path true)
(handler-case
- (load true :verbose nil :print nil)
+ (progn
+ (pushnew path (module-files *module*))
+ (load true :verbose nil :print nil))
(error (error)
(cerror* "Error loading Lisp file ~S: ~A"
path error)))))))))))