chiark / gitweb /
src/classes.lisp, src/class-layout-proto.lisp: Docstring fixes.
[sod] / src / codegen-proto.lisp
index 602b51e52b84856df2590c2804a77f4192f98d6b..f6cd4bdafeccfe72301d921c270b7671d70602fb 100644 (file)
@@ -173,7 +173,8 @@        (defmethod print-object ((,inst-var ,class-name) ,streamvar)
 (definst var (stream :export t) (name type init)
   (pprint-c-type type stream name)
   (when init
 (definst var (stream :export t) (name type init)
   (pprint-c-type type stream name)
   (when init
-    (format stream " = ~A" init)))
+    (format stream " = ~A" init))
+  (write-char #\; stream))
 (definst set (stream :export t) (var expr)
   (format stream "~@<~A = ~@_~2I~A;~:>" var expr))
 (definst update (stream :export t) (var op expr)
 (definst set (stream :export t) (var expr)
   (format stream "~@<~A = ~@_~2I~A;~:>" var expr))
 (definst update (stream :export t) (var op expr)
@@ -187,7 +188,7 @@ (definst continue (stream :export t) ()
 (definst expr (stream :export t) (expr)
   (format stream "~A;" expr))
 (definst block (stream :export t) (decls body)
 (definst expr (stream :export t) (expr)
   (format stream "~A;" expr))
 (definst block (stream :export t) (decls body)
-  (format stream "{~:@_~@<  ~2I~@[~{~A;~:@_~}~:@_~]~{~A~^~:@_~}~:>~:@_}"
+  (format stream "{~:@_~@<  ~2I~@[~{~A~:@_~}~:@_~]~{~A~^~:@_~}~:>~:@_}"
          decls body))
 (definst function (stream :export t) (name type body)
   (pprint-logical-block (stream nil)
          decls body))
 (definst function (stream :export t) (name type body)
   (pprint-logical-block (stream nil)
@@ -260,6 +261,14 @@ (defgeneric emit-insts (codegen insts)
   (:method (codegen insts)
     (dolist (inst insts) (emit-inst codegen inst))))
 
   (:method (codegen insts)
     (dolist (inst insts) (emit-inst codegen inst))))
 
+(export '(emit-decl emit-decls))
+(defgeneric emit-decl (codegen inst)
+  (:documentation
+   "Add INST to the end of CODEGEN's list of declarations."))
+(defgeneric emit-decls (codegen insts)
+  (:documentation
+   "Add a list of INSTS to the end of CODEGEN's list of declarations."))
+
 (export 'codegen-push)
 (defgeneric codegen-push (codegen)
   (:documentation
 (export 'codegen-push)
 (defgeneric codegen-push (codegen)
   (:documentation