X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/81054f0131824964d2cebfd7dec6f18be113020b..a469422e9be4244c098a309e78aa3b761cf0a5ec:/src/module-parse.lisp diff --git a/src/module-parse.lisp b/src/module-parse.lisp index 81a3956..170d61f 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -128,20 +128,13 @@ (define-module (pathname :location location :truename truename) (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 `;' (declare (ignore pset)) (flet ((common (name type what thunk) (when name - (find-file scanner + (find-file (pathname (scanner-filename scanner)) (merge-pathnames name (make-pathname :type type :case :common)) @@ -156,6 +149,7 @@ (define-pluggable-parser module file (scanner pset) :truename true))) (when module (module-import module) + (pushnew path (module-files *module*)) (pushnew module (module-dependencies *module*)))) @@ -170,7 +164,9 @@ (define-pluggable-parser module file (scanner pset) (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)))))))))))