From e7579ef3f607e0e200f0126335043d3fbafa949a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 9 Apr 2004 19:08:53 +0000 Subject: [PATCH] Fixed line number handling for escaped end of lines inside strings. --- tools/wrc/parser.l | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/wrc/parser.l b/tools/wrc/parser.l index 83df1f272bd..2e04bc1f521 100644 --- a/tools/wrc/parser.l +++ b/tools/wrc/parser.l @@ -456,7 +456,7 @@ L\" { \\x[0-9a-fA-F]{1,3} { yyerror("Invalid hex escape sequence '%s'", yytext); } \\[0-9]+ yyerror("Bad escape sequence"); -\\\n{ws}* ; /* backslash at EOL continues string after leading whitespace on next line */ +\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ \\a addwchar('\a'); \\b addwchar('\b'); \\f addwchar('\f'); @@ -464,8 +464,8 @@ L\" { \\r addwchar('\r'); \\t addwchar('\t'); \\v addwchar('\v'); -\\(\n|.) addwchar(yytext[1]); -\\\r\n addwchar(yytext[2]); +\\. addwchar(yytext[1]); +\\\r\n addwchar(yytext[2]); line_number++; char_number = 1; \"\" addwchar('\"'); /* "bla""bla" -> "bla\"bla" */ \\\"\" addwchar('\"'); /* "bla\""bla" -> "bla\"bla" */ \"{ws}+\" ; /* "bla" "bla" -> "blabla" */ @@ -501,7 +501,7 @@ L\" { \\x[0-9a-fA-F] { yyerror("Invalid hex escape sequence '%s'", yytext); } \\[0-9]+ yyerror("Bad escape sequence"); -\\\n{ws}* ; /* backslash at EOL continues string after leading whitespace on next line */ +\\\n{ws}* line_number++; char_number = 1; /* backslash at EOL continues string after leading whitespace on next line */ \\a addcchar('\a'); \\b addcchar('\b'); \\f addcchar('\f'); @@ -509,8 +509,8 @@ L\" { \\r addcchar('\r'); \\t addcchar('\t'); \\v addcchar('\v'); -\\(\n|.) addcchar(yytext[1]); -\\\r\n addcchar(yytext[2]); +\\. addcchar(yytext[1]); +\\\r\n addcchar(yytext[2]); line_number++; char_number = 1; [^\\\n\"]+ { char *yptr = yytext; while(*yptr)