diff --git a/cmd/tools/vvet/vvet.v b/cmd/tools/vvet/vvet.v index 0540b6e199..bbd1b406e3 100644 --- a/cmd/tools/vvet/vvet.v +++ b/cmd/tools/vvet/vvet.v @@ -109,7 +109,7 @@ fn (mut vt Vet) vet_file(path string) { prefs.is_vsh = path.ends_with('.vsh') mut table := ast.new_table() vt.vprintln("vetting file '${path}'...") - file := parser.parse_vet_file(path, mut table, prefs) + file := parser.parse_file(path, mut table, .parse_comments, prefs) vt.stmts(file.stmts) source_lines := os.read_lines(vt.file) or { []string{} } for ln, line in source_lines { diff --git a/vlib/v/parser/parser.v b/vlib/v/parser/parser.v index 20b6b88d43..ce8912ef4b 100644 --- a/vlib/v/parser/parser.v +++ b/vlib/v/parser/parser.v @@ -256,30 +256,6 @@ pub fn parse_file(path string, mut table ast.Table, comments_mode scanner.Commen return res } -pub fn parse_vet_file(path string, mut table_ ast.Table, pref_ &pref.Preferences) &ast.File { - $if trace_parse_vet_file ? { - eprintln('> ${@MOD}.${@FN} path: ${path}') - } - global_scope := &ast.Scope{ - parent: unsafe { nil } - } - mut p := Parser{ - scanner: scanner.new_scanner_file(path, .parse_comments, pref_) or { panic(err) } - table: table_ - pref: pref_ - scope: &ast.Scope{ - start_pos: 0 - parent: global_scope - } - errors: []errors.Error{} - warnings: []errors.Warning{} - } - p.set_path(path) - file := p.parse() - unsafe { p.free_scanner() } - return file -} - pub fn (mut p Parser) parse() &ast.File { util.timing_start('PARSE') defer {