Allow multiple indented blocks in REPL (#6097)

There aren't any tests but being able to do nested for loops seems like
a pretty big win to me so I'm going to put up for review.

The original returned boolean clearly had **false positives** for
detecting bad errors for things like nested `if` and `for` statements.
What is less clear is if there are any **true positives** which I am no
longer catching with the updated return value.

Co-authored-by: Jack O'Connor <jack@jackoconnor.dev>
This commit is contained in:
Jack O'ConnorandJack O'Connor authored and GitHub committed 2025-08-21 13:15:02 +09:00
1 parent ceb7046bc4
commit 109e64c2ba
1 file changed
+1 -5
+1 -5
View File
@@ -86,11 +86,7 @@ fn shell_exec(
continuing_block
} // && p.location.is_some()
ParseErrorType::OtherError(msg) => {
if msg.starts_with("Expected an indented block") {
continuing_block
} else {
true
}
!msg.starts_with("Expected an indented block")
}
_ => true, // !matches!(p, ParseErrorType::UnrecognizedToken(Tok::Dedent, _))
}