Update of /cvsroot/boost/boost/libs/xpressive/proto/test
In directory
sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28762/libs/xpressive/proto/test
Modified Files:
matches.cpp
Log Message:
add proto::not_ and proto::switch_, clean up xpressive's use_simple_repeat
Index: matches.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/xpressive/proto/test/matches.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- matches.cpp 7 Feb 2007 00:46:05 -0000 1.1
+++ matches.cpp 6 Apr 2007 21:03:09 -0000 1.2
@@ -60,6 +60,24 @@
void a_function() {}
+struct MyCases
+{
+ template<typename Expr, typename Tag = typename Expr::tag_type>
+ struct case_
+ : proto::not_<proto::_>
+ {};
+
+ template<typename Expr>
+ struct case_<Expr, proto::tag::right_shift>
+ : proto::_
+ {};
+
+ template<typename Expr>
+ struct case_<Expr, proto::tag::add>
+ : proto::_
+ {};
+};
+
void test_matches()
{
assert_matches< _ >( lit(1) );
@@ -163,6 +181,10 @@
assert_not_matches< function< terminal<int>, vararg< terminal<char> > > >(
lit(1)('a','b','c',"d") );
assert_matches< Anything >( cout_ << 1 << +lit('a') <<
lit(1)('a','b','c',"d") );
+
+ assert_matches< proto::switch_<MyCases> >( lit(1) >> 'a' );
+ assert_matches< proto::switch_<MyCases> >( lit(1) + 'a' );
+ assert_not_matches< proto::switch_<MyCases> >( lit(1) << 'a' );
}
using namespace unit_test;
-------------------------------------------------------------------------
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