mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
repl treats when
s as incomplete until blank line
This commit is contained in:
parent
fccc2ed497
commit
eebf973f11
2 changed files with 26 additions and 17 deletions
|
@ -442,6 +442,11 @@ pub fn is_incomplete(input: &str) -> bool {
|
|||
//
|
||||
// So it's Incomplete until you've pressed Enter again (causing the input to end in "\n")
|
||||
ParseOutcome::ValueDef(ValueDef::Annotation(_, _)) if !input.ends_with('\n') => true,
|
||||
ParseOutcome::Expr(Expr::When(_, _)) => {
|
||||
// There might be lots of `when` branches, so don't assume the user is done entering
|
||||
// them until they enter a blank line!
|
||||
!input.ends_with('\n')
|
||||
}
|
||||
ParseOutcome::Empty
|
||||
| ParseOutcome::Help
|
||||
| ParseOutcome::Exit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue