[Spirit] Problem while parsing a quoted string
Dear list, at the moment I am writing a grammar description in which I want to used quoted string. Up to now I hardcoded the quotes to '"', but now, I want to enable this rule working with a parameter. Maybe I am missing somethin, I hope one can give me good hint: This is the rule definition (for parsing QStrings, I took the code from the example): quotedQString %= lexeme[lit(_r1) >> +(char_ - lit(_r1)) >> lit(_r1)]; qi::rule quotedQString; I am uisng the quotedQString as follows: nextRule = quotedQString('"') [ anAction(_var,_1)]; This does not work as expected, if I parse a string looking like this "String" I always got the quotes included. My old version: quotedQString %= lexeme[lit('"') >> +(char_ - lit('"')) >> lit('"')]; works quite as expected and parses everything without quotes. Kind regards, Sven Steckmann --
participants (1)
-
Sven Steckmann