diff --git a/compiler/main.v b/compiler/main.v index 6e3bbe68d5..47ad596cdc 100644 --- a/compiler/main.v +++ b/compiler/main.v @@ -193,11 +193,6 @@ fn main() { os.mkdir(ModPath) } } - // No args? REPL - if args.len < 2 || (args.len == 2 && args[1] == '-') { - run_repl() - return - } // Construct the V object from command line arguments mut v := new_v(args) if v.pref.is_verbose { @@ -216,6 +211,12 @@ fn main() { v.run_compiled_executable_and_exit() } + // No args? REPL + if args.len < 2 || (args.len == 2 && args[1] == '-') || 'runrepl' in args { + run_repl() + return + } + v.compile() if v.pref.is_test { diff --git a/compiler/tests/repl/repl_test.v b/compiler/tests/repl/repl_test.v index a4ff4b40f3..29eb0cd8fa 100644 --- a/compiler/tests/repl/repl_test.v +++ b/compiler/tests/repl/repl_test.v @@ -50,7 +50,7 @@ fn test_the_v_repl() { input_temporary_filename := 'input_temporary_filename.txt' os.write_file(input_temporary_filename, input) defer { os.rm(input_temporary_filename) } - r := os.exec('$vexec < $input_temporary_filename') or { + r := os.exec('$vexec runrepl < $input_temporary_filename') or { assert false break }