var key, value ast.Expr
switch len(as.Lhs) {
case 2:
- value = as.Lhs[1]
- fallthrough
+ key, value = as.Lhs[0], as.Lhs[1]
case 1:
key = as.Lhs[0]
default:
case token.FOR:
s = p.parseForStmt()
case token.SEMICOLON:
+ s = &ast.EmptyStmt{p.pos}
p.next()
- fallthrough
case token.RBRACE:
// a semicolon may be omitted before a closing "}"
s = &ast.EmptyStmt{p.pos}
// a "correcting" unindent immediately following a line break
// is applied before the line break if there is no comment
// between (see writeWhitespace)
- p.print(unindent, s.Pos())
+ p.print(unindent)
p.expr(s.Label, multiLine)
p.print(token.COLON, indent)
- if _, isEmpty := s.Stmt.(*ast.EmptyStmt); isEmpty {
+ if e, isEmpty := s.Stmt.(*ast.EmptyStmt); isEmpty {
if !nextIsRBrace {
- p.print(newline, s.Stmt.Pos(), token.SEMICOLON)
+ p.print(newline, e.Pos(), token.SEMICOLON)
break
}
} else {
func _() {
switch 0 {
case 0:
- L0: // semicolon required
- ;
+ L0:
+ ; // semicolon required
case 1:
- L1: // semicolon required
- ;
+ L1:
+ ; // semicolon required
default:
L2: // no semicolon needed
}