blueloveTH 2 rokov pred
rodič
commit
c2c1f7bf86
1 zmenil súbory, kde vykonal 4 pridanie a 1 odobranie
  1. 4 1
      src/lexer.cpp

+ 4 - 1
src/lexer.cpp

@@ -318,7 +318,10 @@ static bool is_unicode_Lo_char(uint32_t c) {
                 case '\\': {
                 case '\\': {
                     // line continuation character
                     // line continuation character
                     char c = eatchar_include_newline();
                     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();
                     eat_spaces();
                     return true;
                     return true;
                 }
                 }