mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
d67aa8d76c
commit
c78344ef04
@ -494,7 +494,9 @@ fn run_repl(workdir string, vrepl_prefix string) int {
|
|||||||
}
|
}
|
||||||
if s.output.len > r.last_output.len {
|
if s.output.len > r.last_output.len {
|
||||||
len := r.last_output.len
|
len := r.last_output.len
|
||||||
|
if s.exit_code == 0 {
|
||||||
r.last_output = s.output.clone()
|
r.last_output = s.output.clone()
|
||||||
|
}
|
||||||
cur_line_output := s.output[len..]
|
cur_line_output := s.output[len..]
|
||||||
print_output(cur_line_output)
|
print_output(cur_line_output)
|
||||||
}
|
}
|
||||||
|
15
vlib/v/tests/repl/error_and_continue_print.repl
Normal file
15
vlib/v/tests/repl/error_and_continue_print.repl
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
a = 3
|
||||||
|
b
|
||||||
|
[4, 5].filter(it < 5)
|
||||||
|
===output===
|
||||||
|
error: undefined ident: `a` (use `:=` to declare a variable)
|
||||||
|
5 | import math
|
||||||
|
6 |
|
||||||
|
7 | a = 3
|
||||||
|
| ^
|
||||||
|
error: undefined ident: `b`
|
||||||
|
5 | import math
|
||||||
|
6 |
|
||||||
|
7 | println(b)
|
||||||
|
| ^
|
||||||
|
[4]
|
Loading…
Reference in New Issue
Block a user