From: Josh Bleecher Snyder Date: Thu, 10 Mar 2016 20:29:31 +0000 (-0800) Subject: cmd/compile: continue is the new goto loop X-Git-Tag: go1.7beta1~1417 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9c8f549abbc339fce83f96d80500ab9160a4c84d;p=gostls13.git cmd/compile: continue is the new goto loop Passes toolstash -cmp. Change-Id: I014613985005780d1a622c1981b35a94cda798bb Reviewed-on: https://go-review.googlesource.com/20530 Run-TryBot: Josh Bleecher Snyder Reviewed-by: Matthew Dempsky TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/parser.go b/src/cmd/compile/internal/gc/parser.go index fc97b9aea4..22566efa7d 100644 --- a/src/cmd/compile/internal/gc/parser.go +++ b/src/cmd/compile/internal/gc/parser.go @@ -2073,7 +2073,6 @@ func (p *parser) xdcl_list() (l []*Node) { defer p.trace("xdcl_list")() } -loop: for p.tok != EOF { switch p.tok { case LVAR, LCONST, LTYPE: @@ -2090,7 +2089,7 @@ loop: p.syntax_error("non-declaration statement outside function body") } p.advance(LVAR, LCONST, LTYPE, LFUNC) - goto loop + continue } if nsyntaxerrors == 0 { @@ -2104,7 +2103,6 @@ loop: if p.tok != EOF && !p.got(';') { p.syntax_error("after top level declaration") p.advance(LVAR, LCONST, LTYPE, LFUNC) - goto loop } } return