X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/e05aabbb81cddec46b3d9da802f632c3b20c67d1..88005ae9e51d97c30485739bef5f1ef0f32aac5c:/src/module-parse.lisp diff --git a/src/module-parse.lisp b/src/module-parse.lisp index 311206d..fed98f8 100644 --- a/src/module-parse.lisp +++ b/src/module-parse.lisp @@ -108,9 +108,7 @@ (defun read-module (pathname &key (truename nil truep) location) (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 @@ -128,13 +126,6 @@ (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 `;'