summaryrefslogtreecommitdiff
path: root/boost/spirit/home/x3/core/detail/parse_into_container.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/spirit/home/x3/core/detail/parse_into_container.hpp')
-rw-r--r--boost/spirit/home/x3/core/detail/parse_into_container.hpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/boost/spirit/home/x3/core/detail/parse_into_container.hpp b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
index 96424a4278..45ecc41ae0 100644
--- a/boost/spirit/home/x3/core/detail/parse_into_container.hpp
+++ b/boost/spirit/home/x3/core/detail/parse_into_container.hpp
@@ -202,7 +202,7 @@ namespace boost { namespace spirit { namespace x3 { namespace detail
static bool call(
Parser const& parser
, Iterator& first, Iterator const& last, Context const& context
- , RContext& rcontext, Attribute& attr, mpl::false_)
+ , RContext& rcontext, Attribute& /* attr */, mpl::false_)
{
return parser.parse(first, last, context, rcontext, unused);
}
@@ -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>