repl: fix newline in error messages

pull/4812/head
eyelash 2020-05-10 16:26:56 +02:00 committed by GitHub
parent 8dc0c5a699
commit f396f70ae7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -148,7 +148,7 @@ fn run_repl(workdir string, vrepl_prefix string) {
// but don't add this print call to the `lines` array,
// so that it doesn't get called during the next print.
if r.line.starts_with('print') {
source_code := r.functions.join('\n') + r.lines.join('\n') + '\n' + r.line
source_code := r.functions.join('\n') + r.lines.join('\n') + '\n' + r.line + '\n'
os.write_file(file, source_code)
s := os.exec('"$vexe" -repl run $file') or {
rerror(err)

View File

@ -1,6 +1,6 @@
println(a)
===output===
.vrepl.v:2:20: error: undefined: `a`
.vrepl.v:2:9: error: undefined: `a`
1 |
2 | println(a)
|
| ^