|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r67679 - in trunk/boost/spirit/home/lex: . lexer qi
From: hartmut.kaiser_at_[hidden]
Date: 2011-01-05 08:53:01
Author: hkaiser
Date: 2011-01-05 08:53:00 EST (Wed, 05 Jan 2011)
New Revision: 67679
URL: http://svn.boost.org/trac/boost/changeset/67679
Log:
Spirit: fixing lexer regression introduced with new customization points
Text files modified:
trunk/boost/spirit/home/lex/lexer/token_def.hpp | 14 ++++++++++++++
trunk/boost/spirit/home/lex/qi/state_switcher.hpp | 16 ++++++++++++++++
trunk/boost/spirit/home/lex/reference.hpp | 12 ++++++++++++
3 files changed, 42 insertions(+), 0 deletions(-)
Modified: trunk/boost/spirit/home/lex/lexer/token_def.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/token_def.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/token_def.hpp 2011-01-05 08:53:00 EST (Wed, 05 Jan 2011)
@@ -13,6 +13,7 @@
#include <boost/spirit/home/support/unused.hpp>
#include <boost/spirit/home/support/argument.hpp>
#include <boost/spirit/home/support/info.hpp>
+#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/qi/parser.hpp>
#include <boost/spirit/home/qi/skip_over.hpp>
#include <boost/spirit/home/qi/detail/construct.hpp>
@@ -221,7 +222,20 @@
mutable std::size_t unique_id_;
mutable std::size_t token_state_;
};
+}}}
+namespace boost { namespace spirit { namespace traits
+{
+ ///////////////////////////////////////////////////////////////////////////
+ template<typename Attribute, typename Char, typename Idtype
+ , typename Attr, typename Context, typename Iterator>
+ struct handles_container<
+ lex::token_def<Attribute, Char, Idtype>, Attr, Context, Iterator>
+ : traits::is_container<
+ typename attribute_of<
+ lex::token_def<Attribute, Char, Idtype>, Context, Iterator
+ >::type>
+ {};
}}}
#if defined(BOOST_MSVC)
Modified: trunk/boost/spirit/home/lex/qi/state_switcher.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/qi/state_switcher.hpp (original)
+++ trunk/boost/spirit/home/lex/qi/state_switcher.hpp 2011-01-05 08:53:00 EST (Wed, 05 Jan 2011)
@@ -15,6 +15,8 @@
#include <boost/spirit/home/qi/detail/attributes.hpp>
#include <boost/spirit/home/support/common_terminals.hpp>
#include <boost/spirit/home/support/string_traits.hpp>
+#include <boost/spirit/home/support/has_semantic_action.hpp>
+#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/spirit/home/qi/skip_over.hpp>
#include <boost/spirit/home/qi/domain.hpp>
#include <boost/spirit/home/qi/parser.hpp>
@@ -244,7 +246,21 @@
return result_type(subject, fusion::at_c<0>(term.args));
}
};
+}}}
+
+namespace boost { namespace spirit { namespace traits
+{
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Subject, typename State>
+ struct has_semantic_action<qi::state_switcher_context<Subject, State> >
+ : unary_has_semantic_action<Subject> {};
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Subject, typename State, typename Attribute
+ , typename Context, typename Iterator>
+ struct handles_container<qi::state_switcher_context<Subject, State>
+ , Attribute, Context, Iterator>
+ : unary_handles_container<Subject, Attribute, Context, Iterator> {};
}}}
#endif
Modified: trunk/boost/spirit/home/lex/reference.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/reference.hpp (original)
+++ trunk/boost/spirit/home/lex/reference.hpp 2011-01-05 08:53:00 EST (Wed, 05 Jan 2011)
@@ -15,6 +15,7 @@
#include <boost/spirit/home/lex/lexer_type.hpp>
#include <boost/spirit/home/qi/reference.hpp>
#include <boost/spirit/home/support/info.hpp>
+#include <boost/spirit/home/support/handles_container.hpp>
#include <boost/ref.hpp>
namespace boost { namespace spirit { namespace lex
@@ -67,7 +68,18 @@
return this->ref.get().state();
}
};
+}}}
+namespace boost { namespace spirit { namespace traits
+{
+ ///////////////////////////////////////////////////////////////////////////
+ template <typename Subject, typename IdType
+ , typename Attribute, typename Context, typename Iterator>
+ struct handles_container<lex::reference<Subject, IdType>
+ , Attribute, Context, Iterator>
+ : handles_container<
+ typename remove_const<Subject>::type, Attribute, Context, Iterator>
+ {};
}}}
#endif
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