From 109e64c2bab78f17141906fc90f2037d37dd6733 Mon Sep 17 00:00:00 2001 From: Jack O'Connor Date: Thu, 21 Aug 2025 05:15:02 +0100 Subject: [PATCH] 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 --- src/shell.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index 4222f9627..358b4e6df 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, _)) }