]> Cypherpunks repositories - gostls13.git/commitdiff
more fine-tuning of ;'s
authorRobert Griesemer <gri@golang.org>
Wed, 1 Oct 2008 02:31:27 +0000 (19:31 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 1 Oct 2008 02:31:27 +0000 (19:31 -0700)
R=r
OCL=16274
CL=16274

usr/gri/pretty/printer.go

index 5a6af888787020a5d6d1bb4c5e1d47e3fb2adc52..e6db7ed39dc7d612f6f247623e77e48d6685d41d 100644 (file)
@@ -49,10 +49,10 @@ func (P *Printer) OpenScope(paren string) {
 
 
 func (P *Printer) CloseScope(paren string) {
-       P.level--;
        P.indent--;
-       P.newl = true;
+       P.semi = false;
        P.String(paren);
+       P.level--;
        P.semi, P.newl = false, true;
 }
 
@@ -221,6 +221,7 @@ func (P *Printer) DoFuncDecl(x *AST.FuncDecl) {
        P.DoIdent(x.ident);
        P.DoFunctionType(x.typ);
        if x.body != nil {
+               P.String(" ");
                P.DoBlock(x.body);
        } else {
                P.String(" ;");