Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-12-31 12:48:06


Author: eric_niebler
Date: 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
New Revision: 42391
URL: http://svn.boost.org/trac/boost/changeset/42391

Log:
all proto tests and examples work on vc8, some work on vc7.1
Text files modified:
   branches/proto/v3/boost/xpressive/proto/args.hpp | 18 ++++--------------
   branches/proto/v3/boost/xpressive/proto/context/null.hpp | 2 +-
   branches/proto/v3/boost/xpressive/proto/debug.hpp | 2 +-
   branches/proto/v3/boost/xpressive/proto/detail/arg_c.hpp | 4 ++--
   branches/proto/v3/boost/xpressive/proto/detail/when.hpp | 10 +++++-----
   branches/proto/v3/boost/xpressive/proto/expr.hpp | 2 +-
   branches/proto/v3/boost/xpressive/proto/matches.hpp | 5 +++++
   branches/proto/v3/boost/xpressive/proto/transform/when.hpp | 3 ++-
   branches/proto/v3/libs/xpressive/proto/test/toy_spirit.cpp | 10 ++++++++--
   9 files changed, 29 insertions(+), 27 deletions(-)

Modified: branches/proto/v3/boost/xpressive/proto/args.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/args.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/args.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -22,12 +22,13 @@
 
         namespace argsns_
         {
+ typedef int nil;
 
             template<>
             struct args<>
             {
                 BOOST_STATIC_CONSTANT(long, size = 0);
- typedef cons<> cons_type;
+ typedef nil cons_type;
             };
 
             template<typename A>
@@ -41,14 +42,6 @@
                 typedef A back_;
             };
 
- template<>
- struct cons<>
- {
- BOOST_STATIC_CONSTANT(long, size = 0);
- typedef void car_type;
- typedef void cdr_type;
- };
-
         #define LBRACE(Z, N, DATA) {
         #define RBRACE(Z, N, DATA) }
         #define CDR_TYPE(Z, N, DATA) ::cdr_type
@@ -166,14 +159,11 @@
             BOOST_PP_REPEAT(BOOST_PP_DEC(N), CAR, BOOST_PP_DEC(N))
             typedef BOOST_PP_CAT(A, BOOST_PP_DEC(N)) car_type;
             car_type car;
- static cons<> const cdr;
- typedef cons<> cdr_type;
+ enum dummy_ { cdr = 0 };
+ typedef nil cdr_type;
             BOOST_PP_REPEAT(BOOST_PP_DEC(N), CDR, BOOST_PP_DEC(N))
         };
 
- template< BOOST_PP_ENUM_PARAMS(N, typename A) >
- cons<> const cons< BOOST_PP_ENUM_PARAMS(N, A) > BOOST_PP_REPEAT(BOOST_PP_DEC(N), CDR_TYPE, ~) ::cdr = {};
-
         #if N > 1
         template<typename Cons BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A) >
         inline Cons make_cons_(BOOST_PP_ENUM_BINARY_PARAMS(N, A, &a))

Modified: branches/proto/v3/boost/xpressive/proto/context/null.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/context/null.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/context/null.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -32,7 +32,7 @@
             }
 
         private:
- static void call_(argsns_::cons<> const &, Context &)
+ static void call_(argsns_::nil, Context &)
             {}
 
             template<typename Cons>

Modified: branches/proto/v3/boost/xpressive/proto/debug.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/debug.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/debug.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -151,7 +151,7 @@
             }
 
         private:
- static void call_(display_expr &, argsns_::cons<> const &)
+ static void call_(display_expr &, argsns_::nil)
             {}
 
             template<typename Cons>

Modified: branches/proto/v3/boost/xpressive/proto/detail/arg_c.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/detail/arg_c.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/detail/arg_c.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -27,7 +27,7 @@
             template<typename Cons, long N>
             struct value_at_c;
 
- #define CDR_TYPE(Z, N, DATA) ::cdr_type
+ #define CDR_TYPE(Z, N, DATA) ::BOOST_PP_CAT(S, N)
         #define CDR(Z, N, DATA) .cdr
 
         #ifdef BOOST_HAS_VARIADIC_TMPL
@@ -46,7 +46,7 @@
             template<typename Cons, long N>
             struct arg_cv
             {
- typedef arg_c<typename Cons BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, CDR_TYPE, ~), N-BOOST_PROTO_MAX_ARITY> base_type;
+ typedef arg_cv<typename Cons BOOST_PP_REPEAT(BOOST_PROTO_MAX_ARITY, CDR_TYPE, ~), N-BOOST_PROTO_MAX_ARITY> base_type;
                 typedef typename base_type::type type;
 
                 static type call(Cons const &args)

Modified: branches/proto/v3/boost/xpressive/proto/detail/when.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/detail/when.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/detail/when.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -10,16 +10,16 @@
     #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PROTO_MAX_ARITY, <boost/xpressive/proto/detail/when.hpp>))
     #include BOOST_PP_ITERATE()
 
+ template<typename Grammar, typename Fun>
+ struct when<Grammar, Fun *>
+ : when<Grammar, Fun>
+ {};
+
 #else
 
     #define N BOOST_PP_ITERATION()
 
     template<typename Grammar, typename Return BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
- struct when<Grammar, Return(*)(BOOST_PP_ENUM_PARAMS(N, A))>
- : when<Grammar, Return(BOOST_PP_ENUM_PARAMS(N, A))>
- {};
-
- template<typename Grammar, typename Return BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
     struct when<Grammar, Return(BOOST_PP_ENUM_PARAMS(N, A))>
       : callable, detail::vararg_if<Grammar>
     {

Modified: branches/proto/v3/boost/xpressive/proto/expr.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/expr.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/expr.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -227,7 +227,7 @@
         /// construct
         ///
         template<typename Expr, typename A>
- inline Expr construct(A const &a, typename boost::disable_if<is_function<A> >::type * = 0)
+ inline Expr construct(A const &a, typename boost::disable_if<is_function<A> >::type *)
         {
             typedef typename Expr::proto_args::cons_type cons_type;
             Expr that = {proto::argsns_::make_cons_<cons_type>(a)};

Modified: branches/proto/v3/boost/xpressive/proto/matches.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/matches.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/matches.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -157,6 +157,11 @@
               : array_matches<T[M], U>
             {};
 
+ template<typename T, std::size_t M>
+ struct lambda_matches<T[M], T[M] BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1)>
+ : mpl::true_
+ {};
+
             // How terminal_matches<> handles references and cv-qualifiers.
             // The cv and ref matter *only* if the grammar has a top-level ref.
             //

Modified: branches/proto/v3/boost/xpressive/proto/transform/when.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/proto/transform/when.hpp (original)
+++ branches/proto/v3/boost/xpressive/proto/transform/when.hpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -14,6 +14,7 @@
 #include <boost/xpressive/proto/traits.hpp>
 #include <boost/xpressive/proto/transform/call.hpp>
 #include <boost/xpressive/proto/transform/make.hpp>
+#include <boost/function_types/is_function_pointer.hpp>
 
 namespace boost { namespace proto { namespace transform
 {
@@ -34,7 +35,7 @@
     // Simple transform, takes a raw transform and
     // applies it directly.
     template<typename Grammar, typename Fun>
- struct when
+ struct when
       : Fun, detail::vararg_if<Grammar>
     {
         typedef typename Grammar::proto_base_expr proto_base_expr;

Modified: branches/proto/v3/libs/xpressive/proto/test/toy_spirit.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto/test/toy_spirit.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto/test/toy_spirit.cpp 2007-12-31 12:48:05 EST (Mon, 31 Dec 2007)
@@ -197,16 +197,22 @@
         // The visitor determines the case-sensitivity of the terminals
         typedef _visitor _icase;
 
+ // Ugh, would be nice to find a work-around for this:
+ #if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+ #define _arg(x) call<_arg(x)>
+ #define True() make<True()>
+ #endif
+
         // Extract the arg from terminals
         struct SpiritTerminal
           : or_<
                 when< AnyChar, _arg >
               , when< CharLiteral, if_<_icase, ichar(_arg), _arg> >
- , when< CharParser, if_<_icase, ichar(_arg(_arg1)), _arg(_arg1)> > // char_('a')
+ , when< CharParser, if_<_icase, ichar(_arg(_arg1)), _arg(_arg1)> > // char_('a')
               , when< NTBSLiteral, if_<_icase, istr(_arg), char const*(_arg)> >
               , when< CharRangeParser, if_<_icase
                                             , ichar_range(_arg(_arg1), _arg(_arg2))
- , char_range(_arg(_arg1), _arg(_arg2))> >// char_('a','z')
+ , char_range(_arg(_arg1), _arg(_arg2))> > // char_('a','z')
>
         {};
 


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