~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/go/printer/nodes.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
1158
1158
 
1159
1159
        case *ast.SelectStmt:
1160
1160
                p.print(token.SELECT, blank)
1161
 
                p.block(s.Body, 0)
1162
 
                *multiLine = true
 
1161
                body := s.Body
 
1162
                if len(body.List) == 0 && !p.commentBefore(p.fset.Position(body.Rbrace)) {
 
1163
                        // print empty select statement w/o comments on one line
 
1164
                        p.print(body.Lbrace, token.LBRACE, body.Rbrace, token.RBRACE)
 
1165
                } else {
 
1166
                        p.block(body, 0)
 
1167
                        *multiLine = true
 
1168
                }
1163
1169
 
1164
1170
        case *ast.ForStmt:
1165
1171
                p.print(token.FOR)