|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r84814 - in trunk: boost/spirit/home/karma/directive libs/spirit/test/karma
From: hartmut.kaiser_at_[hidden]
Date: 2013-06-17 09:11:30
Author: hkaiser
Date: 2013-06-17 09:11:30 EDT (Mon, 17 Jun 2013)
New Revision: 84814
URL: http://svn.boost.org/trac/boost/changeset/84814
Log:
Spirit: fixing a problem in karma::omit
Text files modified:
trunk/boost/spirit/home/karma/directive/omit.hpp | 2 +-
trunk/libs/spirit/test/karma/omit.cpp | 15 +++++++++++++++
2 files changed, 16 insertions(+), 1 deletions(-)
Modified: trunk/boost/spirit/home/karma/directive/omit.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/directive/omit.hpp Mon Jun 17 07:46:53 2013 (r84813)
+++ trunk/boost/spirit/home/karma/directive/omit.hpp 2013-06-17 09:11:30 EDT (Mon, 17 Jun 2013) (r84814)
@@ -77,7 +77,7 @@
if (Execute) {
// wrap the given output iterator to avoid output
detail::disable_output<OutputIterator> disable(sink);
- subject.generate(sink, ctx, d, attr);
+ return subject.generate(sink, ctx, d, attr);
}
return true;
}
Modified: trunk/libs/spirit/test/karma/omit.cpp
==============================================================================
--- trunk/libs/spirit/test/karma/omit.cpp Mon Jun 17 07:46:53 2013 (r84813)
+++ trunk/libs/spirit/test/karma/omit.cpp 2013-06-17 09:11:30 EDT (Mon, 17 Jun 2013) (r84814)
@@ -47,6 +47,21 @@
BOOST_TEST(test("15", r, a));
}
+ // even if omit[] never fails, it has to honor the result of the
+ // embedded generator
+ {
+ typedef std::pair<double, double> attribute_type;
+ rule<outiter_type, attribute_type()> r;
+
+ r %= omit[double_(1.0) << double_] | "42";
+
+ attribute_type p1 (1.0, 2.0);
+ BOOST_TEST(test("", r, p1));
+
+ attribute_type p2 (10.0, 2.0);
+ BOOST_TEST(test("42", r, p2));
+ }
+
// skip[] is not supposed to execute the embedded generator
{
using boost::spirit::karma::double_;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk