vfmt: remove unused variable check for vfmt
parent
8be10ffbd6
commit
cc4090cc74
|
@ -192,7 +192,7 @@ pub fn (mut p Parser) open_scope() {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn (mut p Parser) close_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() {
|
for v in p.scope.unused_vars() {
|
||||||
if p.pref.is_prod {
|
if p.pref.is_prod {
|
||||||
p.error_with_pos('Unused variable: $v.name', v.pos)
|
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.end_pos = p.tok.pos
|
||||||
p.scope.parent.children << p.scope
|
p.scope.parent.children << p.scope
|
||||||
p.scope = p.scope.parent
|
p.scope = p.scope.parent
|
||||||
|
|
Loading…
Reference in New Issue