From c2c1f7bf86d2de4b308969a1d93b2c0afff3abce Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 10 Aug 2023 01:54:31 +0800 Subject: [PATCH] ... --- src/lexer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lexer.cpp b/src/lexer.cpp index 718731d3..79c32f0d 100644 --- a/src/lexer.cpp +++ b/src/lexer.cpp @@ -318,7 +318,10 @@ static bool is_unicode_Lo_char(uint32_t c) { case '\\': { // line continuation character char c = eatchar_include_newline(); - if (c != '\n') SyntaxError("expected newline after line continuation character"); + if (c != '\n'){ + if(src->mode == REPL_MODE && c == '\0') throw NeedMoreLines(false); + SyntaxError("expected newline after line continuation character"); + } eat_spaces(); return true; }