Handle syntax errors in repl

This commit is contained in:
Richard Feldman 2022-10-31 06:22:35 -04:00
parent 6227e37559
commit e6bd2a5f30
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -463,7 +463,7 @@ pub fn is_incomplete(input: &str) -> bool {
let arena = Bump::new();
match parse_src(&arena, input) {
ParseOutcome::Incomplete => true,
ParseOutcome::Incomplete => !input.ends_with('\n'),
// Standalone annotations are default incomplete, because we can't know
// whether they're about to annotate a body on the next line
// (or if not, meaning they stay standalone) until you press Enter again!