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

Modified Files:
        grammar.hpp 
Log Message:
xpressive grammar allows for narrow literals in wide regexes

Index: grammar.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/xpressive/detail/static/grammar.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- grammar.hpp 18 Nov 2006 22:04:20 -0000      1.3
+++ grammar.hpp 19 Nov 2006 04:50:53 -0000      1.4
@@ -13,6 +13,7 @@
 # pragma once
 #endif
 
+#include <boost/mpl/or.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/xpressive/proto/proto_fwd.hpp>
 #include <boost/xpressive/proto/matches.hpp>
@@ -33,6 +34,7 @@
 {
     namespace detail
     {
+        // is_generic_repeat
         template<typename T>
         struct is_generic_repeat
           : mpl::false_
@@ -43,10 +45,55 @@
           : mpl::true_
         {};
 
+        // is_xpressive_literal_impl
+        template<typename Char, typename T>
+        struct is_xpressive_literal_impl
+          : mpl::false_
+        {};
+
+        template<typename Char>
+        struct is_xpressive_literal_impl<Char, Char>
+          : mpl::true_
+        {};
+
+        template<typename Char>
+        struct is_xpressive_literal_impl<Char, Char const *>
+          : mpl::true_
+        {};
+
+        template<typename Char>
+        struct is_xpressive_literal_impl<Char, string_placeholder<Char> >
+          : mpl::true_
+        {};
+
+        template<typename Char, typename Not>
+        struct is_xpressive_literal_impl<Char, literal_placeholder<Char, Not> >
+          : mpl::true_
+        {};
+
+        template<typename Char, typename Traits, typename Alloc>
+        struct is_xpressive_literal_impl<Char, std::basic_string<Char, Traits, 
Alloc> >
+          : mpl::true_
+        {};
+
+        // is_xpressive_literal
+        template<typename Char, typename T>
+        struct is_xpressive_literal
+          : mpl::or_<
+                is_xpressive_literal_impl<Char, T>
+              , is_xpressive_literal_impl<char, T>
+            >
+        {};
+
+        template<typename T>
+        struct is_xpressive_literal<char, T>
+          : is_xpressive_literal_impl<char, T>
+        {};
+
         // is_xpressive_terminal
         template<typename Char, typename T>
         struct is_xpressive_terminal
-          : mpl::false_
+          : is_xpressive_literal<Char, T>
         {};
 
         template<typename Char>
@@ -114,35 +161,10 @@
           : mpl::true_
         {};
 
-        template<typename Char, typename Traits, typename Alloc>
-        struct is_xpressive_terminal<Char, std::basic_string<Char, Traits, 
Alloc> >
-          : mpl::true_
-        {};
-
         template<typename Char, typename BidiIter>
         struct is_xpressive_terminal<Char, xpressive::basic_regex<BidiIter> >
           : mpl::true_
         {};
-
-        template<typename Char>
-        struct is_xpressive_terminal<Char, Char>
-          : mpl::true_
-        {};
-
-        template<typename Char>
-        struct is_xpressive_terminal<Char, Char const *>
-          : mpl::true_
-        {};
-
-        template<typename Char>
-        struct is_xpressive_terminal<Char, string_placeholder<Char> >
-          : mpl::true_
-        {};
-
-        template<typename Char, typename Not>
-        struct is_xpressive_terminal<Char, literal_placeholder<Char, Not> >
-          : mpl::true_
-        {};
     }
 
     template<typename Char>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to