boost spirit parsing quote string fails
问题 This is my grammer unesc_char.add(L"\\a", L'\a')(L"\\b", L'\b')(L"\\f", L'\f')(L"\\n", L'\n') (L"\\r", L'\r')(L"\\t", L'\t')(L"\\v", L'\v')(L"\\\\", L'\\') (L"\\\'", L'\'')(L"\\\"", L'\"'); unesc_str = '\"' >> *((boost::spirit::standard_wide::char_ - '\"') | unesc_char) >> '\"'; with qi::rule<Iterator, std::wstring()> unesc_str; qi::symbols<wchar_t const, wchar_t const> unesc_char; Parsing fails on : "Hello\"" -> should return Hello" Parsing correct on : "Hello\\" -> should return Hello\