|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r56745 - in branches/release/boost/spirit: home home/qi/nonterminal home/qi/numeric/detail home/support repository/home/qi/nonterminal
From: hartmut.kaiser_at_[hidden]
Date: 2009-10-12 12:45:27
Author: hkaiser
Date: 2009-10-12 12:45:26 EDT (Mon, 12 Oct 2009)
New Revision: 56745
URL: http://svn.boost.org/trac/boost/changeset/56745
Log:
Spirit: merging bug fixes from trunk
Properties modified:
branches/release/boost/spirit/home/ (props changed)
branches/release/boost/spirit/home/qi/nonterminal/rule.hpp (contents, props changed)
branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (contents, props changed)
branches/release/boost/spirit/home/support/attributes.hpp (contents, props changed)
branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp (contents, props changed)
Text files modified:
branches/release/boost/spirit/home/qi/nonterminal/rule.hpp | 8 ++++----
branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 2 +-
branches/release/boost/spirit/home/support/attributes.hpp | 10 +++++++++-
branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp | 8 ++++----
4 files changed, 18 insertions(+), 10 deletions(-)
Modified: branches/release/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ branches/release/boost/spirit/home/qi/nonterminal/rule.hpp 2009-10-12 12:45:26 EDT (Mon, 12 Oct 2009)
@@ -221,8 +221,8 @@
typedef traits::transform_attribute<
typename make_attribute::type, attr_type> transform;
- typename transform::type attr_ =
- transform::pre(make_attribute::call(attr));
+ typename make_attribute::type made_attr = make_attribute::call(attr);
+ typename transform::type attr_ = transform::pre(made_attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
@@ -261,8 +261,8 @@
typedef traits::transform_attribute<
typename make_attribute::type, attr_type> transform;
- typename transform::type attr_ =
- transform::pre(make_attribute::call(attr));
+ typename make_attribute::type made_attr = make_attribute::call(attr);
+ typename transform::type attr_ = transform::pre(made_attr);
// If you are seeing a compilation error here, you are probably
// trying to use a rule or a grammar which has inherited
Modified: branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp
==============================================================================
--- branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp (original)
+++ branches/release/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp 2009-10-12 12:45:26 EDT (Mon, 12 Oct 2009)
@@ -445,7 +445,7 @@
{
if (count == 0) // must have at least one digit
return false;
- attr = 0;
+ traits::assign_to(0, attr);
first = it;
return true;
}
Modified: branches/release/boost/spirit/home/support/attributes.hpp
==============================================================================
--- branches/release/boost/spirit/home/support/attributes.hpp (original)
+++ branches/release/boost/spirit/home/support/attributes.hpp 2009-10-12 12:45:26 EDT (Mon, 12 Oct 2009)
@@ -325,7 +325,6 @@
typedef Transformed type;
static Transformed pre(Exposed& val) { return Transformed(val); }
- static Transformed pre(Exposed const& val) { return Transformed(val); }
// By default do post transformation only if types are convertible,
// otherwise we assume no post transform is required (i.e. the user
@@ -352,6 +351,15 @@
// Karma only, no post() required
};
+ // handle case where no transformation is required as the types are the same
+ template <typename Attribute>
+ struct transform_attribute<Attribute, Attribute>
+ {
+ typedef Attribute& type;
+ static Attribute& pre(Attribute& val) { return val; }
+ static void post(Attribute& val, Attribute const& attr) {}
+ };
+
template <typename Attribute>
struct transform_attribute<Attribute const, Attribute>
{
Modified: branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp
==============================================================================
--- branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp (original)
+++ branches/release/boost/spirit/repository/home/qi/nonterminal/subrule.hpp 2009-10-12 12:45:26 EDT (Mon, 12 Oct 2009)
@@ -204,8 +204,8 @@
typedef traits::transform_attribute<
typename make_attribute::type, subrule_attr_type> transform;
- typename transform::type attr_ =
- transform::pre(make_attribute::call(attr));
+ typename make_attribute::type made_attr = make_attribute::call(attr);
+ typename transform::type attr_ = transform::pre(made_attr);
// If you are seeing a compilation error here, you are probably
// trying to use a subrule which has inherited attributes,
@@ -254,8 +254,8 @@
typedef traits::transform_attribute<
typename make_attribute::type, subrule_attr_type> transform;
- typename transform::type attr_ =
- transform::pre(make_attribute::call(attr));
+ typename make_attribute::type made_attr = make_attribute::call(attr);
+ typename transform::type attr_ = transform::pre(made_attr);
// If you are seeing a compilation error here, you are probably
// trying to use a subrule which has inherited attributes,
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