Update of /cvsroot/boost/boost/boost/xpressive
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18708

Modified Files:
        regex_primitives.hpp 
Log Message:
small tweak

Index: regex_primitives.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/regex_primitives.hpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- regex_primitives.hpp        1 Jun 2007 19:09:28 -0000       1.37
+++ regex_primitives.hpp        2 Jun 2007 00:23:57 -0000       1.38
@@ -9,6 +9,7 @@
 #ifndef BOOST_XPRESSIVE_REGEX_PRIMITIVES_HPP_EAN_10_04_2005
 #define BOOST_XPRESSIVE_REGEX_PRIMITIVES_HPP_EAN_10_04_2005
 
+#include <vector>
 #include <climits>
 #include <boost/mpl/if.hpp>
 #include <boost/mpl/and.hpp>
@@ -21,6 +22,7 @@
 // Doxygen can't handle proto :-(
 #ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED
 # include <boost/xpressive/proto/proto.hpp>
+# include <boost/xpressive/proto/transform/arg.hpp>
 # include <boost/xpressive/detail/core/icase.hpp>
 # include <boost/xpressive/detail/static/compile.hpp>
 # include <boost/xpressive/detail/static/modifier.hpp>
@@ -52,47 +54,35 @@
 
     template<typename Grammar>
     struct push_back_sub
-      : Grammar
+      : proto::trans::identity<Grammar>
     {
-        template<typename Expr, typename, typename>
-        struct apply { typedef Expr type; };
-
-        template<typename Expr, typename State, typename Visitor>
-        static Expr const &call(Expr const &expr, State const &, Visitor &subs)
+        template<typename Sub>
+        static int to_sub(Sub const &sub, proto::tag::terminal)
         {
-            subs.push_back(proto::arg(expr).mark_number_);
-            return expr;
+            return proto::arg(sub).mark_number_;
         }
-    };
 
-    template<typename Grammar>
-    struct push_back_int
-      : Grammar
-    {
-        template<typename Expr, typename, typename>
-        struct apply { typedef Expr type; };
+        template<typename Sub>
+        static int to_sub(Sub const &, proto::tag::negate)
+        {
+            return -1;
+        }
 
         template<typename Expr, typename State, typename Visitor>
         static Expr const &call(Expr const &expr, State const &, Visitor &subs)
         {
-            subs.push_back(-1);
+            subs.push_back(push_back_sub::to_sub(expr, typename 
Expr::tag_type()));
             return expr;
         }
     };
 
     // s1 or -s1
     struct SubMatch
-      : proto::or_<
-            push_back_sub< proto::terminal<mark_placeholder> >
-          , push_back_int< proto::negate<proto::terminal<mark_placeholder> > >
-        >
+      : push_back_sub<proto::or_<basic_mark_tag, proto::negate<basic_mark_tag 
> > >
     {};
 
     struct SubMatchList
-      : proto::or_<
-            proto::comma<SubMatch, SubMatch>
-          , proto::comma<SubMatchList, SubMatch>
-        >
+      : proto::or_<SubMatch, proto::comma<SubMatchList, SubMatch> >
     {};
 
     template<typename Subs>


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to