Commit 7fd9cfd0 authored by Robert Griesemer's avatar Robert Griesemer

- parser bug: return keyword may be followed by case or default keyword as well

- fixed unrelated typo

R=rsc
DELTA=2  (0 added, 0 deleted, 2 changed)
OCL=30175
CL=30175
parent 52891952
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment