From d35c578924c511a716d5c0ff915b28004db9aebd Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Tue, 5 Dec 2023 12:26:36 -0500 Subject: [PATCH] Make it easier to exit `roc repl` --- crates/repl_ui/src/repl_state.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/repl_ui/src/repl_state.rs b/crates/repl_ui/src/repl_state.rs index fb93db61bd..6f2e7103f6 100644 --- a/crates/repl_ui/src/repl_state.rs +++ b/crates/repl_ui/src/repl_state.rs @@ -206,7 +206,11 @@ pub fn parse_src<'a>(arena: &'a Bump, line: &'a str) -> ParseOutcome<'a> { match line.trim().to_lowercase().as_str() { "" => ParseOutcome::Empty, ":help" => ParseOutcome::Help, - ":exit" | ":quit" | ":q" => ParseOutcome::Exit, + // These are all common things beginners try. + // Let people exit the repl easily! + // If you really need to evaluate `exit` for some reason, + // you can do `foo = exit` and then evaluate `foo` instead. + ":exit" | ":quit" | ":q" | "exit" | "quit" | "exit()" | "quit()" => ParseOutcome::Exit, _ => { let src_bytes = line.as_bytes();