Add PRODUCE-COMMENT

This commit is contained in:
John Lorentzson 2025-05-08 19:32:54 +02:00
parent 8dd78265b4
commit 5ca740efa9

View file

@ -14,6 +14,9 @@
(push label *compile-result*) (push label *compile-result*)
label) label)
(defun produce-comment (text)
(push text *compile-result*))
(defmacro format-inst (destination control-string &rest format-arguments) (defmacro format-inst (destination control-string &rest format-arguments)
`(format ,destination "~C~A~%" #\Tab (format nil ,control-string ,@format-arguments))) `(format ,destination "~C~A~%" #\Tab (format nil ,control-string ,@format-arguments)))
@ -49,7 +52,7 @@
((%next :accessor next :accessor normal-next :initform nil))) ((%next :accessor next :accessor normal-next :initform nil)))
(defmethod generate-code :before ((node node)) (defmethod generate-code :before ((node node))
(format t ";; ~A~%" node)) (produce-comment (format nil "~A" node)))
(defmethod generate-code :after ((node node)) (defmethod generate-code :after ((node node))
(terpri)) (terpri))