include doublequote characters in string literal token text

This commit is contained in:
Josh Holtrop 2018-05-20 16:11:36 -04:00
parent db08091cf4
commit 9f2f6be9bb

View File

@ -150,12 +150,13 @@ L?\" {
{ {
delete build_string; delete build_string;
} }
build_string = new std::string(); build_string = new std::string("\"");
BEGIN(str); BEGIN(str);
} }
<str>{ <str>{
\" { \" {
BEGIN(INITIAL); BEGIN(INITIAL);
*build_string += "\"";
(*yylval)->token.text = build_string; (*yylval)->token.text = build_string;
build_string = nullptr; build_string = nullptr;
return STRING_LITERAL; return STRING_LITERAL;