compiler: clears MainFn when recompile on repl

This commit is contained in:
Henrixounez 2019-06-28 17:15:52 +02:00 committed by Alexander Medvednikov
parent 748c45203d
commit b6b313d246
2 changed files with 8 additions and 0 deletions

View file

@ -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)