mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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 <josharian@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
ed4a27a8dd
commit
9c8f549abb
1 changed files with 1 additions and 3 deletions
|
|
@ -2073,7 +2073,6 @@ func (p *parser) xdcl_list() (l []*Node) {
|
||||||
defer p.trace("xdcl_list")()
|
defer p.trace("xdcl_list")()
|
||||||
}
|
}
|
||||||
|
|
||||||
loop:
|
|
||||||
for p.tok != EOF {
|
for p.tok != EOF {
|
||||||
switch p.tok {
|
switch p.tok {
|
||||||
case LVAR, LCONST, LTYPE:
|
case LVAR, LCONST, LTYPE:
|
||||||
|
|
@ -2090,7 +2089,7 @@ loop:
|
||||||
p.syntax_error("non-declaration statement outside function body")
|
p.syntax_error("non-declaration statement outside function body")
|
||||||
}
|
}
|
||||||
p.advance(LVAR, LCONST, LTYPE, LFUNC)
|
p.advance(LVAR, LCONST, LTYPE, LFUNC)
|
||||||
goto loop
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if nsyntaxerrors == 0 {
|
if nsyntaxerrors == 0 {
|
||||||
|
|
@ -2104,7 +2103,6 @@ loop:
|
||||||
if p.tok != EOF && !p.got(';') {
|
if p.tok != EOF && !p.got(';') {
|
||||||
p.syntax_error("after top level declaration")
|
p.syntax_error("after top level declaration")
|
||||||
p.advance(LVAR, LCONST, LTYPE, LFUNC)
|
p.advance(LVAR, LCONST, LTYPE, LFUNC)
|
||||||
goto loop
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue