summaryrefslogtreecommitdiff
path: root/py/repl.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/repl.c')
-rw-r--r--py/repl.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/py/repl.c b/py/repl.c
index 5dce8bbb7..da0fefb3a 100644
--- a/py/repl.c
+++ b/py/repl.c
@@ -106,8 +106,13 @@ bool mp_repl_continue_with_input(const char *input) {
}
}
- // continue if unmatched brackets or quotes
- if (n_paren > 0 || n_brack > 0 || n_brace > 0 || in_quote == Q_3_SINGLE || in_quote == Q_3_DOUBLE) {
+ // continue if unmatched 3-quotes
+ if (in_quote == Q_3_SINGLE || in_quote == Q_3_DOUBLE) {
+ return true;
+ }
+
+ // continue if unmatched brackets, but only if not in a 1-quote
+ if ((n_paren > 0 || n_brack > 0 || n_brace > 0) && in_quote == Q_NONE) {
return true;
}