From 251716fa0e36f4358675b163ebfd772542d98411 Mon Sep 17 00:00:00 2001 From: yuyi Date: Fri, 3 Jun 2022 00:59:57 +0800 Subject: [PATCH] vrepl: fix error for exitasdfasdf in repl (fix #14593) (#14598) --- cmd/tools/vrepl.v | 15 +++++++-------- vlib/v/tests/repl/error_exitasdfasdf.repl | 7 +++++++ 2 files changed, 14 insertions(+), 8 deletions(-) create mode 100644 vlib/v/tests/repl/error_exitasdfasdf.repl diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index 27f2fcd3ca..2e29383750 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -305,7 +305,6 @@ fn run_repl(workdir string, vrepl_prefix string) int { return int(rc) } } - break } r.line = line if r.line == '\n' { @@ -388,13 +387,13 @@ fn run_repl(workdir string, vrepl_prefix string) int { '#include ', 'for ', 'or ', - 'insert', - 'delete', - 'prepend', - 'sort', - 'clear', - 'trim', - 'as', + 'insert(', + 'delete(', + 'prepend(', + 'sort(', + 'clear(', + 'trim(', + ' as ', ] mut is_statement := false if filter_line.count('=') % 2 == 1 { diff --git a/vlib/v/tests/repl/error_exitasdfasdf.repl b/vlib/v/tests/repl/error_exitasdfasdf.repl new file mode 100644 index 0000000000..a026a8ee1a --- /dev/null +++ b/vlib/v/tests/repl/error_exitasdfasdf.repl @@ -0,0 +1,7 @@ +exitasdfasdf +===output=== +error: undefined ident: `exitasdfasdf` + 5 | import math + 6 | + 7 | println(exitasdfasdf) + | ~~~~~~~~~~~~