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

yuyi 2022-04-23 03:33:13 +08:00 committed by Jef Roosens
parent 7325727e38
commit 0a30a90924
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
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() spos := p.tok.pos()
name := p.check_name() name := p.check_name()
if name in p.label_names { 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.label_names << name
p.next() p.next()
@ -812,7 +812,7 @@ pub fn (mut p Parser) stmt(is_top_level bool) ast.Stmt {
return stmt return stmt
} }
else { else {
p.error_with_pos('unknown kind of For statement', for_pos) return p.error_with_pos('unknown kind of For statement', for_pos)
} }
} }
} }