2
0
mirror of https://github.com/boostorg/spirit.git synced 2026-01-19 16:52:10 +00:00

Fixed bug where string("string1") >> attr(std::string("string2")) produces the wrong attribute result

This commit is contained in:
Joel de Guzman
2016-07-06 22:50:36 +08:00
parent 2759bf97e4
commit 379413a50c

View File

@@ -251,7 +251,13 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
, Iterator& first, Iterator const& last
, Context const& context, RContext& rcontext, Attribute& attr, mpl::true_)
{
return parser.parse(first, last, context, rcontext, attr);
if (attr.empty())
return parser.parse(first, last, context, rcontext, attr);
Attribute rest;
bool r = parser.parse(first, last, context, rcontext, rest);
if (r)
attr.insert(attr.end(), rest.begin(), rest.end());
return r;
}
template <typename Iterator, typename Attribute>