From 135ccae33d823410fc4ef2af06cb33513c1689ba Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Fri, 15 Aug 2025 22:55:46 +0100 Subject: [PATCH] Allow multiple indented blocks in REPL 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. --- src/shell.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index 4222f962719..358b4e6df71 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -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, _)) }