mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
compiler: checks if variables are unused on scripts main function
This commit is contained in:
parent
165dfe5fe0
commit
d8caa6431f
2 changed files with 12 additions and 6 deletions
|
@ -230,6 +230,10 @@ fn (p mut Parser) parse() {
|
|||
p.cgen.consts << g
|
||||
case EOF:
|
||||
p.log('end of parse()')
|
||||
if p.is_script && !p.is_test {
|
||||
p.cur_fn = MainFn
|
||||
p.check_unused_variables()
|
||||
}
|
||||
if true && !p.first_run() && p.fileis('test') {
|
||||
out := os.create('/var/tmp/fmt.v')
|
||||
out.appendln(p.scanner.fmt_out.str())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue