]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/classic/test/while_p_as_parser_tests.cpp
1 /*=============================================================================
2 Copyright (c) 2003 Martin Wille
3 http://spirit.sourceforge.net/
5 Use, modification and distribution is subject to the Boost Software
6 License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 http://www.boost.org/LICENSE_1_0.txt)
8 =============================================================================*/
9 #include <boost/spirit/include/classic_core.hpp>
10 #include <boost/spirit/include/classic_while.hpp>
16 bool operator()() const;
22 //////////////////////////////////
23 // compile time check wether as_parser<> works for while_p
25 ::BOOST_SPIRIT_CLASSIC_NS::rule
<> r
;
27 r
= ::BOOST_SPIRIT_CLASSIC_NS::while_p('-')['-'];
28 r
= ::BOOST_SPIRIT_CLASSIC_NS::while_p("-")["-"];
30 r
= ::BOOST_SPIRIT_CLASSIC_NS::while_p(&fun
)["foo"];
31 r
= ::BOOST_SPIRIT_CLASSIC_NS::while_p(ftor())["foo"];
33 r
= ::BOOST_SPIRIT_CLASSIC_NS::while_p(r
)[r
];
35 r
= ::BOOST_SPIRIT_CLASSIC_NS::do_p
['-'].while_p('-');
36 r
= ::BOOST_SPIRIT_CLASSIC_NS::do_p
["-"].while_p("-");
38 r
= ::BOOST_SPIRIT_CLASSIC_NS::do_p
["foo"].while_p(&fun
);
39 r
= ::BOOST_SPIRIT_CLASSIC_NS::do_p
["foo"].while_p(ftor());
41 r
= ::BOOST_SPIRIT_CLASSIC_NS::do_p
[r
].while_p(r
);