- Handle doubled double quotes:

`"""foo"" bar"' -> `"foo" bar'
- Handle C++ style comments.

Requested by:	 wpaul
This commit is contained in:
mdodd 2004-01-11 21:10:35 +00:00
parent 3ec434ff43
commit 68868822fb

View File

@ -64,9 +64,10 @@ update_lineno(const char *cp)
\n { lineno++; return EOL; } \n { lineno++; return EOL; }
\r ; \r ;
;.*$ ; ;.*$ ;
\/\/.*$ ;
= { return EQUALS; } = { return EQUALS; }
, { return COMMA; } , { return COMMA; }
\"(\\\"|[^"])*\" { \"(\\\"|[^"]|\"\")*\" {
int len = strlen(yytext) - 2; int len = strlen(yytext) - 2;
int blen = len + 1; int blen = len + 1;
char *walker; char *walker;
@ -77,6 +78,15 @@ update_lineno(const char *cp)
goto out; goto out;
walker = yylval.str; walker = yylval.str;
for (i = 1; i <= len; i++) { for (i = 1; i <= len; i++) {
if (yytext[i] == '\"') {
switch (yytext[i + 1]) {
case '\"':
i++;
break;
default:
break;
}
}
if (yytext[i] == '\\') { if (yytext[i] == '\\') {
switch (yytext[i + 1]) { switch (yytext[i + 1]) {
case '\n': case '\n':