diff -ur spirit.orig/home/qi/auxiliary/attr_cast.hpp spirit/home/qi/auxiliary/attr_cast.hpp --- spirit.orig/home/qi/auxiliary/attr_cast.hpp 2011-10-12 21:22:46.000000000 +1100 +++ spirit/home/qi/auxiliary/attr_cast.hpp 2011-10-24 20:54:18.657878715 +1100 @@ -92,17 +92,17 @@ typename transform::type attr_ = transform::pre(attr); - if (!compile(subject). + if (compile(subject). parse(first, last, context, skipper, attr_)) { - transform::fail(attr); - return false; + // do up-stream transformation, this mainly integrates the results + // back into the original attribute value, if appropriate + if (traits::post_transform(attr, attr_)) + return true; } - // do up-stream transformation, this mainly integrates the results - // back into the original attribute value, if appropriate - traits::post_transform(attr, attr_); - return true; + transform::fail(attr); + return false; } template diff -ur spirit.orig/home/qi/detail/attributes.hpp spirit/home/qi/detail/attributes.hpp --- spirit.orig/home/qi/detail/attributes.hpp 2011-10-12 21:22:46.000000000 +1100 +++ spirit/home/qi/detail/attributes.hpp 2011-10-24 20:49:24.097277462 +1100 @@ -22,9 +22,10 @@ static Transformed pre(Exposed&) { return Transformed(); } - static void post(Exposed& val, Transformed const& attr) + static bool post(Exposed& val, Transformed const& attr) { traits::assign_to(attr, val); + return true; } // fail() will be called by Qi rule's if the rhs failed parsing @@ -37,7 +38,7 @@ { typedef Attribute& type; static Attribute& pre(Attribute& val) { return val; } - static void post(Attribute&, Attribute const&) {} + static bool post(Attribute&, Attribute const&) { return true; } static void fail(Attribute&) {} }; @@ -47,7 +48,7 @@ typedef Transformed type; static Transformed pre(Exposed& val) { return Transformed(val); } - static void post(Exposed&, Transformed const&) { /* no-op */ } + static bool post(Exposed&, Transformed const&) { return true; } // fail() will be called by Qi rule's if the rhs failed parsing static void fail(Exposed&) {} @@ -59,7 +60,7 @@ { typedef Attribute& type; static Attribute& pre(Attribute& val) { return val; } - static void post(Attribute&, Attribute const&) {} + static bool post(Attribute&, Attribute const&) { return true; } static void fail(Attribute&) {} }; @@ -87,7 +88,7 @@ val = Transformed(); return boost::get(val); } - static void post(boost::optional&, Transformed const&) {} + static bool post(boost::optional&, Transformed const&) { return true; } static void fail(boost::optional& val) { val = none_t(); // leave optional uninitialized if rhs failed @@ -100,7 +101,7 @@ { typedef Attribute& type; static Attribute& pre(Attribute& val) { return val; } - static void post(Attribute&, Attribute const&) {} + static bool post(Attribute&, Attribute const&) { return true; } static void fail(Attribute&) {} }; @@ -110,7 +111,7 @@ { typedef unused_type type; static unused_type pre(unused_type) { return unused; } - static void post(unused_type, unused_type) {} + static bool post(unused_type, unused_type) { return true; } static void fail(unused_type) {} }; @@ -160,7 +161,7 @@ /////////////////////////////////////////////////////////////////////////// template - void post_transform(Exposed& dest, Transformed const& attr) + bool post_transform(Exposed& dest, Transformed const& attr) { return transform_attribute::post(dest, attr); } diff -ur spirit.orig/home/qi/nonterminal/rule.hpp spirit/home/qi/nonterminal/rule.hpp --- spirit.orig/home/qi/nonterminal/rule.hpp 2011-10-12 21:22:46.000000000 +1100 +++ spirit/home/qi/nonterminal/rule.hpp 2011-10-24 20:52:01.678942752 +1100 @@ -293,8 +293,8 @@ { // do up-stream transformation, this integrates the results // back into the original attribute value, if appropriate - traits::post_transform(attr, attr_); - return true; + if (traits::post_transform(attr, attr_)) + return true; } // inform attribute transformation of failed rhs @@ -339,8 +339,8 @@ { // do up-stream transformation, this integrates the results // back into the original attribute value, if appropriate - traits::post_transform(attr, attr_); - return true; + if (traits::post_transform(attr, attr_)) + return true; } // inform attribute transformation of failed rhs diff -ur spirit.orig/home/support/adapt_adt_attributes.hpp spirit/home/support/adapt_adt_attributes.hpp --- spirit.orig/home/support/adapt_adt_attributes.hpp 2011-10-12 21:22:39.000000000 +1100 +++ spirit/home/support/adapt_adt_attributes.hpp 2011-10-24 20:33:51.100900977 +1100 @@ -257,12 +257,13 @@ { return val; } - static void + static bool post( fusion::extension::adt_attribute_proxy& val , Attribute const& attr) { val = attr; + return true; } static void fail(fusion::extension::adt_attribute_proxy&) @@ -289,11 +290,12 @@ { return val; } - static void + static bool post( fusion::extension::adt_attribute_proxy& , Attribute const&) { + return true; } static void fail(fusion::extension::adt_attribute_proxy&) diff -ur spirit.orig/repository/home/qi/nonterminal/subrule.hpp spirit/repository/home/qi/nonterminal/subrule.hpp --- spirit.orig/repository/home/qi/nonterminal/subrule.hpp 2011-10-12 21:22:52.000000000 +1100 +++ spirit/repository/home/qi/nonterminal/subrule.hpp 2011-10-24 20:58:42.703929387 +1100 @@ -217,8 +217,8 @@ { // do up-stream transformation, this integrates the results // back into the original attribute value, if appropriate - traits::post_transform(attr, attr_); - return true; + if (traits::post_transform(attr, attr_)) + return true; } // inform attribute transformation of failed rhs @@ -271,8 +271,8 @@ { // do up-stream transformation, this integrates the results // back into the original attribute value, if appropriate - traits::post_transform(attr, attr_); - return true; + if (traits::post_transform(attr, attr_)) + return true; } // inform attribute transformation of failed rhs