sql.l: strip string start/end delimiters from value
This commit is contained in:
5
sql.l
5
sql.l
@ -295,7 +295,10 @@ FALSE { yylval->intval = 0; return BOOL; }
|
||||
/* strings */
|
||||
|
||||
'(\\.|''|[^'\n])*' |
|
||||
\"(\\.|\"\"|[^"\n])*\" { yylval->strval = strdup(yytext); return STRING; }
|
||||
\"(\\.|\"\"|[^"\n])*\" {
|
||||
size_t duplen = strlen(yytext) - 2;
|
||||
yylval->strval = strndup(&yytext[1], duplen);
|
||||
return STRING; }
|
||||
|
||||
'(\\.|[^'\n])*$ { yyerror(yylloc, pstate->scanner, pstate, "Unterminated string %s", yytext); }
|
||||
\"(\\.|[^"\n])*$ { yyerror(yylloc, pstate->scanner, pstate, "Unterminated string %s", yytext); }
|
||||
|
Reference in New Issue
Block a user