mirror of
https://github.com/boostorg/spirit.git
synced 2026-01-19 04:42:11 +00:00
@@ -28,25 +28,18 @@ namespace boost { namespace spirit { namespace x3
|
||||
Iterator& first, Iterator const& last
|
||||
, Context const& context, RContext& rcontext, Attribute& attr) const
|
||||
{
|
||||
Iterator current(first);
|
||||
for (/**/; current != last; ++current)
|
||||
for (Iterator current(first);; ++current)
|
||||
{
|
||||
if (this->subject.parse(current, last, context, rcontext, attr))
|
||||
{
|
||||
first = current;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// Test for when subjects match on input empty. Example:
|
||||
// comment = "//" >> seek[eol | eoi]
|
||||
if (this->subject.parse(current, last, context, rcontext, attr))
|
||||
{
|
||||
first = current;
|
||||
return true;
|
||||
// fail only after subject fails & no input
|
||||
if (current == last)
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -97,5 +97,8 @@ int main()
|
||||
);
|
||||
}
|
||||
|
||||
// past the end regression GH#658
|
||||
BOOST_TEST(!test(" ", seek['x'], space));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
@@ -93,5 +93,8 @@ int main()
|
||||
BOOST_TEST(test_failure("abcdefg", x3::seek[x3::int_]));
|
||||
}
|
||||
|
||||
// past the end regression GH#658
|
||||
BOOST_TEST(!test(" ", x3::seek['x'], x3::space));
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user