X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/e05aabbb81cddec46b3d9da802f632c3b20c67d1..refs/heads/mdw/progfmt:/src/module-output.lisp diff --git a/src/module-output.lisp b/src/module-output.lisp index f9eb3a4..21fcadd 100644 --- a/src/module-output.lisp +++ b/src/module-output.lisp @@ -102,26 +102,27 @@ ;;;-------------------------------------------------------------------------- ;;; Output implementation. -(defmethod hook-output progn ((module module) reason sequencer) +(defmethod hook-output :after ((module module) reason sequencer) ;; Ask the module's items to sequence themselves. (dolist (item (module-items module)) (hook-output item reason sequencer))) -(defmethod hook-output progn ((frag code-fragment-item) reason sequencer) +(defmethod hook-output ((frag code-fragment-item) reason sequencer) ;; Output fragments when their reasons are called up. (when (eq reason (code-fragment-reason frag)) (dolist (constraint (code-fragment-constraints frag)) (add-sequencer-constraint sequencer constraint)) - (add-sequencer-item-function sequencer (code-fragment-name frag) - (lambda (stream) - (write (code-fragment frag) - :stream stream - :pretty nil - :escape nil))))) - -(defmethod hook-output progn ((module module) (reason (eql :h)) sequencer) + (awhen (code-fragment-name frag) + (add-sequencer-item-function sequencer it + (lambda (stream) + (write (code-fragment frag) + :stream stream + :pretty nil + :escape nil)))))) + +(defmethod hook-output ((module module) (reason (eql :h)) sequencer) (sequence-output (stream sequencer) :constraint @@ -131,6 +132,7 @@ (:includes :start) :includes :early-decls (:includes :end) (:early-user :start) :early-user (:early-user :end) (:classes :start) (:classes :end) + (:static-instances :start) :static-instances (:static-instances :end) (:user :start) :user (:user :end) (:guard :end) :epilogue) @@ -173,13 +175,16 @@ ((:includes :end) (terpri stream)))) -(defmethod hook-output progn ((module module) (reason (eql :c)) sequencer) +(defmethod hook-output ((module module) (reason (eql :c)) sequencer) (sequence-output (stream sequencer) :constraint (:prologue (:includes :start) :includes (:includes :end) (:early-user :start) :early-user (:early-user :end) + (:static-instances :start) + (:static-instances :decls) (:static-instances :gap) + (:static-instances :end) (:classes :start) (:classes :end) (:user :start) :user (:user :end) :epilogue) @@ -265,13 +270,12 @@ ;; filetype case to do that. Make a pathname and inspect it to ;; find out how to do this. - (if (upper-case-p - (char (pathname-type (make-pathname - :type "TEST" - :case :common)) - 0)) - #'string-upcase - #'string-downcase)) + (if (upper-case-p (char (pathname-type (make-pathname + :type "TEST" + :case :common)) + 0)) + #'string-upcase + #'string-downcase)) (outpath (output-type-pathname reason)) (deppath (make-pathname :type (concatenate 'string