diff --git a/src/libjsparser/lexer.c b/src/libjsparser/lexer.c index 5b20368a1..8435898c4 100644 --- a/src/libjsparser/lexer.c +++ b/src/libjsparser/lexer.c @@ -776,7 +776,10 @@ parse_string (void) /* Only single escape character is allowed. */ if (LA (1) == 'x' || LA (1) == 'u' || __isdigit (LA (1))) { - PARSE_SORRY ("Escape sequences are not supported yet", token_start - buffer_start); + PARSE_WARN ("Escape sequences are ignored yet", token_start - buffer_start); + consume_char (); + consume_char (); + continue; } if ((LA (1) == '\'' && !is_double_quoted) || (LA (1) == '"' && is_double_quoted) diff --git a/src/libjsparser/parse-error.h b/src/libjsparser/parse-error.h index e000f543a..2e79a018f 100644 --- a/src/libjsparser/parse-error.h +++ b/src/libjsparser/parse-error.h @@ -28,6 +28,11 @@ __printf ("ERROR: Ln %d, Col %d: %s\n", line + 1, column + 1, MESSAGE); \ __exit (-1); \ } while (0) +#define PARSE_WARN(MESSAGE, LOCUS) do { \ + size_t line, column; \ + lexer_locus_to_line_and_column ((size_t) (LOCUS), &line, &column); \ + __printf ("WARNING: Ln %d, Col %d: %s\n", line + 1, column + 1, MESSAGE); \ +} while (0) #define PARSE_ERROR_VARG(MESSAGE, LOCUS, ...) do { \ size_t line, column; \ lexer_locus_to_line_and_column ((size_t) (LOCUS), &line, &column); \ @@ -36,7 +41,7 @@ for (size_t i = 0; i < column; i++) { \ __putchar (' '); \ } \ - __printf ("\n^\n"); \ + __printf ("^\n"); \ __printf ("ERROR: Ln %d, Col %d: ", line + 1, column + 1); \ __printf (MESSAGE, __VA_ARGS__); \ __printf ("\n"); \