Make it easier to exit roc repl

This commit is contained in:
Richard Feldman 2023-12-05 12:26:36 -05:00
parent 263f9ceb41
commit d35c578924
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B

View File

@ -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();