]> Cypherpunks repositories - gostls13.git/commitdiff
require ";" separator after function literals
authorRobert Griesemer <gri@golang.org>
Fri, 3 Apr 2009 05:59:57 +0000 (22:59 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 3 Apr 2009 05:59:57 +0000 (22:59 -0700)
R=rsc
DELTA=1  (1 added, 0 deleted, 0 changed)
OCL=27057
CL=27059

src/lib/go/parser.go

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