Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54789 - trunk/boost/spirit/home/karma/operator
From: hartmut.kaiser_at_[hidden]
Date: 2009-07-07 19:55:54


Author: hkaiser
Date: 2009-07-07 19:55:53 EDT (Tue, 07 Jul 2009)
New Revision: 54789
URL: http://svn.boost.org/trac/boost/changeset/54789

Log:
Spirit: fixed karma plus and kleene failure conditions
Text files modified:
   trunk/boost/spirit/home/karma/operator/kleene.hpp | 4 ++--
   trunk/boost/spirit/home/karma/operator/plus.hpp | 3 ++-
   2 files changed, 4 insertions(+), 3 deletions(-)

Modified: trunk/boost/spirit/home/karma/operator/kleene.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/kleene.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/kleene.hpp 2009-07-07 19:55:53 EDT (Tue, 07 Jul 2009)
@@ -68,13 +68,13 @@
             iterator_type it = traits::begin(attr);
             iterator_type end = traits::end(attr);
 
- // kleene fails only if the embedded parser fails
+ // kleene fails only if the underlying output fails
             bool result = true;
             for (/**/; result && !traits::compare(it, end); traits::next(it))
             {
                 result = subject.generate(sink, ctx, d, traits::deref(it));
             }
- return result;
+ return sink.good();
         }
 
         template <typename Context>

Modified: trunk/boost/spirit/home/karma/operator/plus.hpp
==============================================================================
--- trunk/boost/spirit/home/karma/operator/plus.hpp (original)
+++ trunk/boost/spirit/home/karma/operator/plus.hpp 2009-07-07 19:55:53 EDT (Tue, 07 Jul 2009)
@@ -72,12 +72,13 @@
             if (traits::compare(it, end))
                 return false;
 
+ // from now on plus fails only if the underlying output fails
             bool result = true;
             for (/**/; result && !traits::compare(it, end); traits::next(it))
             {
                 result = subject.generate(sink, ctx, d, traits::deref(it));
             }
- return result;
+ return sink.good();
         }
 
         template <typename Context>


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