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

repl: dont save line if last compilation errored

This commit is contained in:
Henrixounez 2019-08-18 17:45:56 +02:00 committed by Alexander Medvednikov
parent f654c4af7a
commit aae063b9ad
2 changed files with 8 additions and 1 deletions

View File

@ -1375,7 +1375,9 @@ fn run_repl() []string {
s := os.exec('$vexe run $temp_file -repl') or {
panic(err)
}
lines << line
if !s.exit_code {
lines << line
}
vals := s.output.split('\n')
for i:=0; i<vals.len; i++ {
println(vals[i])

View File

@ -0,0 +1,5 @@
a
33
===output===
.vrepl_temp.v:2 undefined: `a`
33