1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

vfmt: remove unused variable check for vfmt

This commit is contained in:
Delyan Angelov 2020-04-24 20:25:11 +03:00
parent 8be10ffbd6
commit cc4090cc74

View File

@ -192,7 +192,7 @@ pub fn (mut p Parser) open_scope() {
}
pub fn (mut p Parser) close_scope() {
if !p.pref.is_repl {
if !p.pref.is_repl && !scanner.is_fmt {
for v in p.scope.unused_vars() {
if p.pref.is_prod {
p.error_with_pos('Unused variable: $v.name', v.pos)
@ -201,7 +201,7 @@ pub fn (mut p Parser) close_scope() {
}
}
}
p.scope.clear_unused_vars()
p.scope.clear_unused_vars()
p.scope.end_pos = p.tok.pos
p.scope.parent.children << p.scope
p.scope = p.scope.parent