Skip to content

Commit 135ccae

Browse files
author
Jack O'Connor
committed
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.
1 parent a9a9e3b commit 135ccae

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/shell.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ fn shell_exec(
8686
continuing_block
8787
} // && p.location.is_some()
8888
ParseErrorType::OtherError(msg) => {
89-
if msg.starts_with("Expected an indented block") {
90-
continuing_block
91-
} else {
92-
true
93-
}
89+
!msg.starts_with("Expected an indented block")
9490
}
9591
_ => true, // !matches!(p, ParseErrorType::UnrecognizedToken(Tok::Dedent, _))
9692
}

0 commit comments

Comments
 (0)