From: Mark Wooding Date: Sun, 30 Aug 2015 09:59:45 +0000 (+0100) Subject: src/codegen-proto.lisp: Include `;' in `var-inst' output. X-Git-Tag: 0.2.0~53 X-Git-Url: https://git.distorted.org.uk/~mdw/sod/commitdiff_plain/75dbacfca91031ad04d2464926239e329ffc5ca4 src/codegen-proto.lisp: Include `;' in `var-inst' output. Because other kinds of decls will have their own semicolons. Previously the semicolons were added as part of the block output machinery. --- diff --git a/src/codegen-proto.lisp b/src/codegen-proto.lisp index 602b51e..743c89f 100644 --- a/src/codegen-proto.lisp +++ b/src/codegen-proto.lisp @@ -173,7 +173,8 @@ (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) @@ -187,7 +188,7 @@ (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)