]> Cypherpunks repositories - gostls13.git/commitdiff
- parser bug: return keyword may be followed by case or default keyword as well
authorRobert Griesemer <gri@golang.org>
Wed, 10 Jun 2009 22:40:19 +0000 (15:40 -0700)
committerRobert Griesemer <gri@golang.org>
Wed, 10 Jun 2009 22:40:19 +0000 (15:40 -0700)
- fixed unrelated typo

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=30175
CL=30175

src/pkg/go/parser/parser.go

index 05686869560eff7fd57013a1b11ebad329e24f5e..11c0ee1725a9e7ab847a0e0e4d940dedac7b15bd 100644 (file)
@@ -1314,7 +1314,7 @@ func (p *parser) parseReturnStmt() *ast.ReturnStmt {
        pos := p.pos;
        p.expect(token.RETURN);
        var x []ast.Expr;
-       if p.tok != token.SEMICOLON && p.tok != token.RBRACE {
+       if p.tok != token.SEMICOLON && p.tok != token.CASE && p.tok != token.DEFAULT && p.tok != token.RBRACE {
                x = p.parseExpressionList();
        }
 
@@ -1431,7 +1431,7 @@ func (p *parser) parseCaseClause() *ast.CaseClause {
 
 func (p *parser) parseTypeCaseClause() *ast.TypeCaseClause {
        if p.trace {
-               defer un(trace(p, "CaseClause"));
+               defer un(trace(p, "TypeCaseClause"));
        }
 
        // TypeSwitchCase