mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
compiler: clears MainFn when recompile on repl
This commit is contained in:
parent
748c45203d
commit
b6b313d246
2 changed files with 8 additions and 0 deletions
|
@ -249,6 +249,9 @@ fn (p mut Parser) parse() {
|
|||
}
|
||||
if p.cur_fn.name == '' {
|
||||
p.cur_fn = MainFn
|
||||
if p.is_repl {
|
||||
p.cur_fn.clear_vars()
|
||||
}
|
||||
}
|
||||
start := p.cgen.lines.len
|
||||
p.statement(true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue