parser: minor cleanup in stmt() (#14136)
parent
7325727e38
commit
0a30a90924
|
@ -791,7 +791,7 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
|
|||
spos := p.tok.pos()
|
||||
name := p.check_name()
|
||||
if name in p.label_names {
|
||||
p.error_with_pos('duplicate label `$name`', spos)
|
||||
return p.error_with_pos('duplicate label `$name`', spos)
|
||||
}
|
||||
p.label_names << name
|
||||
p.next()
|
||||
|
@ -812,7 +812,7 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
|
|||
return stmt
|
||||
}
|
||||
else {
|
||||
p.error_with_pos('unknown kind of For statement', for_pos)
|
||||
return p.error_with_pos('unknown kind of For statement', for_pos)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue