Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71030 - in trunk/boost/spirit/home/lex: . lexer
From: thom.heller_at_[hidden]
Date: 2011-04-06 08:36:18


Author: theller
Date: 2011-04-06 08:36:16 EDT (Wed, 06 Apr 2011)
New Revision: 71030
URL: http://svn.boost.org/trac/boost/changeset/71030

Log:
[spirit]

Fixed MSVC non template custom terminal

Text files modified:
   trunk/boost/spirit/home/lex/argument_phoenix.hpp | 103 ++++++++++++++++++++++++++-------------
   trunk/boost/spirit/home/lex/lexer/support_functions_expression.hpp | 25 +++++++++
   2 files changed, 92 insertions(+), 36 deletions(-)

Modified: trunk/boost/spirit/home/lex/argument_phoenix.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/argument_phoenix.hpp (original)
+++ trunk/boost/spirit/home/lex/argument_phoenix.hpp 2011-04-06 08:36:16 EDT (Wed, 06 Apr 2011)
@@ -27,6 +27,8 @@
     {
         typedef mpl::true_ no_nullary;
 
+ typedef unused_type result_type;
+
         template <typename Env>
         struct result
         {
@@ -57,6 +59,8 @@
     {
         typedef mpl::true_ no_nullary;
 
+ typedef unused_type result_type;
+
         template <typename Env>
         struct result
         {
@@ -77,42 +81,6 @@
     struct eoi_getter;
 }}}
 
-BOOST_PHOENIX_DEFINE_CUSTOM_TERMINAL(
- template<>
- , boost::spirit::lex::value_context
- , mpl::false_
- , v2_eval(
- proto::make<boost::spirit::lex::value_getter()>
- , proto::call<
- functional::env(proto::_state)
- >
- )
-)
-
-BOOST_PHOENIX_DEFINE_CUSTOM_TERMINAL(
- template<>
- , boost::spirit::lex::state_context
- , mpl::false_
- , v2_eval(
- proto::make<boost::spirit::lex::state_getter()>
- , proto::call<
- functional::env(proto::_state)
- >
- )
-)
-
-BOOST_PHOENIX_DEFINE_CUSTOM_TERMINAL(
- template<>
- , boost::spirit::lex::eoi_getter
- , mpl::false_
- , v2_eval(
- proto::make<boost::spirit::lex::eoi_getter()>
- , proto::call<
- functional::env(proto::_state)
- >
- )
-)
-
 ///////////////////////////////////////////////////////////////////////////////
 #ifdef BOOST_SPIRIT_USE_PHOENIX_V3
 
@@ -128,6 +96,27 @@
 
 namespace boost { namespace phoenix
 {
+ namespace result_of
+ {
+ template <>
+ struct is_nullary<custom_terminal<boost::spirit::lex::value_context> >
+ : mpl::false_
+ {};
+ }
+
+ template <typename Dummy>
+ struct is_custom_terminal<boost::spirit::lex::value_context, Dummy>: mpl::true_ {};
+
+ template <typename Dummy>
+ struct custom_terminal<boost::spirit::lex::value_context, Dummy>
+ : proto::call<
+ v2_eval(
+ proto::make<boost::spirit::lex::value_getter()>
+ , proto::call<functional::env(proto::_state)>
+ )
+ >
+ {};
+
     template <typename Dummy>
     struct is_nullary::when<spirit::lex::rule::value_setter, Dummy>
       : proto::make<mpl::false_()>
@@ -170,6 +159,27 @@
>::make(phoenix::as_actor<Expr>::convert(expr));
         }
     };
+
+ namespace result_of
+ {
+ template <>
+ struct is_nullary<custom_terminal<boost::spirit::lex::state_context> >
+ : mpl::false_
+ {};
+ }
+
+ template <typename Dummy>
+ struct is_custom_terminal<boost::spirit::lex::state_context, Dummy>: mpl::true_ {};
+
+ template <typename Dummy>
+ struct custom_terminal<boost::spirit::lex::state_context, Dummy>
+ : proto::call<
+ v2_eval(
+ proto::make<boost::spirit::lex::state_getter()>
+ , proto::call<functional::env(proto::_state)>
+ )
+ >
+ {};
 
     template <typename Dummy>
     struct is_nullary::when<spirit::lex::rule::state_setter, Dummy>
@@ -213,6 +223,27 @@
>::make(phoenix::as_actor<Expr>::convert(expr));
         }
     };
+
+ namespace result_of
+ {
+ template <>
+ struct is_nullary<custom_terminal<boost::spirit::lex::eoi_getter> >
+ : mpl::false_
+ {};
+ }
+
+ template <typename Dummy>
+ struct is_custom_terminal<boost::spirit::lex::eoi_getter, Dummy>: mpl::true_ {};
+
+ template <typename Dummy>
+ struct custom_terminal<boost::spirit::lex::eoi_getter, Dummy>
+ : proto::call<
+ v2_eval(
+ proto::make<boost::spirit::lex::eoi_getter()>
+ , proto::call<functional::env(proto::_state)>
+ )
+ >
+ {};
 }}
 
 #endif // BOOST_SPIRIT_USE_PHOENIX_V3

Modified: trunk/boost/spirit/home/lex/lexer/support_functions_expression.hpp
==============================================================================
--- trunk/boost/spirit/home/lex/lexer/support_functions_expression.hpp (original)
+++ trunk/boost/spirit/home/lex/lexer/support_functions_expression.hpp 2011-04-06 08:36:16 EDT (Wed, 06 Apr 2011)
@@ -20,6 +20,7 @@
     template <typename, typename> struct lookahead_type;
 }}}
 
+/*
 BOOST_PHOENIX_DEFINE_CUSTOM_TERMINAL(
     template <>
   , boost::spirit::lex::more_type
@@ -29,6 +30,7 @@
       , proto::call<functional::env(proto::_state)>
     )
 )
+*/
 
 ///////////////////////////////////////////////////////////////////////////////
 #ifndef BOOST_SPIRIT_USE_PHOENIX_V3
@@ -76,6 +78,29 @@
 
 namespace boost { namespace phoenix
 {
+
+ namespace result_of
+ {
+ template <>
+ struct is_nullary<custom_terminal<boost::spirit::lex::more_type> >
+ : mpl::false_
+ {};
+ }
+
+ template <typename Dummy>
+ struct is_custom_terminal<boost::spirit::lex::more_type, Dummy>: mpl::true_ {};
+
+ template <typename Dummy>
+ struct custom_terminal<boost::spirit::lex::more_type, Dummy>
+ : proto::call<
+ v2_eval(
+ proto::make<boost::spirit::lex::more_type()>
+ , proto::call<functional::env(proto::_state)>
+ )
+ >
+ {};
+
+
     template <typename Dummy>
     struct is_nullary::when<spirit::lex::rule::less, Dummy>
       : proto::make<mpl::false_()>


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