parser: minor cleanup in stmt() (#14136)

master
yuyi 2022-04-23 03:33:13 +08:00 committed by GitHub
parent a2db44bc38
commit b86320a669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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)
}
}
}