Skip to content

Commit 73c79b9

Browse files
committed
py: Continue line if last character is backslash.
1 parent 443e018 commit 73c79b9

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

py/repl.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,11 @@ bool mp_repl_continue_with_input(const char *input) {
6767
return true;
6868
}
6969

70+
// continue if last character was backslash (for line continuation)
71+
if (i[-1] == '\\') {
72+
return true;
73+
}
74+
7075
// continue if compound keyword and last line was not empty
7176
if (starts_with_compound_keyword && i[-1] != '\n') {
7277
return true;

0 commit comments

Comments
 (0)