From 0a30a9092414d6d4ac91b29d648f7d3b5789532f Mon Sep 17 00:00:00 2001 From: yuyi Date: Sat, 23 Apr 2022 03:33:13 +0800 Subject: [PATCH] parser: minor cleanup in stmt() (#14136) --- vlib/v/parser/parser.v | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 7ab644576a..1e7200a651 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -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) } } }