From 5f36874c9b77f52d8d64bc66e32100f74a5f9d63 Mon Sep 17 00:00:00 2001 From: yuyi Date: Wed, 24 Jun 2020 18:45:48 +0800 Subject: [PATCH] vrepl: fix optional call --- cmd/tools/vrepl.v | 2 +- vlib/v/tests/repl/optional_call.repl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 vlib/v/tests/repl/optional_call.repl diff --git a/cmd/tools/vrepl.v b/cmd/tools/vrepl.v index f32f4f4dec..1a83cc7bf6 100644 --- a/cmd/tools/vrepl.v +++ b/cmd/tools/vrepl.v @@ -198,7 +198,7 @@ fn run_repl(workdir string, vrepl_prefix string) { '=', '++', '--', '<<', '//', '/*', 'fn ', 'pub ', 'mut ', 'enum ', 'const ', 'struct ', 'interface ', 'import ', - '#include ', ':=', 'for ' + '#include ', ':=', 'for ', 'or ' ] mut is_statement := false for pattern in possible_statement_patterns { diff --git a/vlib/v/tests/repl/optional_call.repl b/vlib/v/tests/repl/optional_call.repl new file mode 100644 index 0000000000..6a7937cb4b --- /dev/null +++ b/vlib/v/tests/repl/optional_call.repl @@ -0,0 +1,3 @@ +import os +os.cp('', '') or {return} +===output===