X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/4effe5759a1229be4ce152db87172119ddcb45bb..e5573634ce3668f2a4eac74be125262d28a5cb8a:/src/codegen-proto.lisp diff --git a/src/codegen-proto.lisp b/src/codegen-proto.lisp index 7a6be33..767f35b 100644 --- a/src/codegen-proto.lisp +++ b/src/codegen-proto.lisp @@ -251,8 +251,26 @@ ;; Compound statements. (definst block (stream :export t) (decls body) - (format stream "{~:@_~@< ~2I~@[~{~A~:@_~}~:@_~]~{~A~^~:@_~}~:>~:@_}" - decls body)) + (write-char #\{ stream) + (pprint-newline :mandatory stream) + (pprint-logical-block (stream nil) + (let ((newlinep nil)) + (flet ((newline () + (if newlinep + (pprint-newline :mandatory stream) + (setf newlinep t)))) + (pprint-indent :block 2 stream) + (write-string " " stream) + (when decls + (dolist (decl decls) + (newline) + (write decl :stream stream)) + (when body (newline))) + (dolist (inst body) + (newline) + (write inst :stream stream))))) + (pprint-newline :mandatory stream) + (write-char #\} stream)) (definst if (stream :export t) (#1=#:cond conseq &optional alt) (let ((stmt "if"))