]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/syntax: remove unused code
authorgriesemer <gri@golang.org>
Fri, 6 Oct 2017 23:44:12 +0000 (16:44 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 9 Oct 2017 17:44:08 +0000 (17:44 +0000)
Change-Id: I9c75dee7e4498cc11c08cad1ae34ff2af75f1469
Reviewed-on: https://go-review.googlesource.com/69071
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/syntax/parser.go

index b9129b0d9cd2cb2ae8032a959bc428b0f5241e61..f9100526973822bed0959aa58d75da693da26ba6 100644 (file)
@@ -1171,22 +1171,6 @@ func (p *parser) interfaceType() *InterfaceType {
        return typ
 }
 
-// FunctionBody = Block .
-func (p *parser) funcBody() []Stmt {
-       if trace {
-               defer p.trace("funcBody")()
-       }
-
-       p.fnest++
-       body := p.stmtList()
-       p.fnest--
-
-       if body == nil {
-               body = []Stmt{new(EmptyStmt)}
-       }
-       return body
-}
-
 // Result = Parameters | Type .
 func (p *parser) funcResult() []*Field {
        if trace {
@@ -1676,6 +1660,11 @@ func (p *parser) blockStmt(context string) *BlockStmt {
                defer p.trace("blockStmt")()
        }
 
+       // TODO(gri) If we are in a function we should update p.fnest
+       // accordingly. Currently p.fnest is always zero and thus not
+       // used in error recovery.
+       // Not enabled for for because it performs worse for some code
+       // without more fine tuning (see example in #22164).
        s := new(BlockStmt)
        s.pos = p.pos()