1
0
mirror of https://github.com/golang/go synced 2024-11-22 13:24:53 -07:00

require ";" separator after function literals

R=rsc
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=27057
CL=27059
This commit is contained in:
Robert Griesemer 2009-04-02 22:59:57 -07:00
parent bfea141ca8
commit 27d1159ab4

View File

@ -824,6 +824,7 @@ func (p *parser) parseFuncLit() ast.Expr {
typ := p.parseFuncType(); typ := p.parseFuncType();
p.expr_lev++; p.expr_lev++;
body := p.parseBlockStmt(); body := p.parseBlockStmt();
p.opt_semi = false; // function body requires separating ";"
p.expr_lev--; p.expr_lev--;
return &ast.FuncLit{typ, body}; return &ast.FuncLit{typ, body};