From dea3d0431d2e5d6f7d0e78715ff8e4fba5fd7e6b Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 28 Dec 2020 17:58:44 +0800 Subject: [PATCH] parser: minor cleanup of `parse_block_no_scope()` (#7644) --- vlib/v/parser/parser.v | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 6d11ae01f8..5f1c78e763 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -364,15 +364,15 @@ pub fn (mut p Parser) parse_block_no_scope(is_top_level bool) []ast.Stmt { p.check(.lcbr) mut stmts := []ast.Stmt{} if p.tok.kind != .rcbr { - mut c := 0 + mut count := 0 for p.tok.kind !in [.eof, .rcbr] { stmts << p.stmt(is_top_level) - c++ - if c % 100000 == 0 { - eprintln('parsed $c statements so far from fn $p.cur_fn_name ...') + count++ + if count % 100000 == 0 { + eprintln('parsed $count statements so far from fn $p.cur_fn_name ...') } - if c > 1000000 { - p.error_with_pos('parsed over $c statements from fn $p.cur_fn_name, the parser is probably stuck', + if count > 1000000 { + p.error_with_pos('parsed over $count statements from fn $p.cur_fn_name, the parser is probably stuck', p.tok.position()) return [] }