]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/spirit/test/x3/skip.cpp
1 /*=============================================================================
2 Copyright (c) 2001-2015 Joel de Guzman
3 Copyright (c) 2013 Agustin Berge
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 =============================================================================*/
8 #include <boost/detail/lightweight_test.hpp>
9 #include <boost/spirit/home/x3.hpp>
17 using spirit_test::test
;
18 using spirit_test::test_attr
;
19 using boost::spirit::x3::ascii::space
;
20 using boost::spirit::x3::ascii::space_type
;
21 using boost::spirit::x3::ascii::char_
;
22 using boost::spirit::x3::ascii::alpha
;
23 using boost::spirit::x3::lexeme
;
24 using boost::spirit::x3::skip
;
25 using boost::spirit::x3::lit
;
28 BOOST_TEST((test("a b c d", skip(space
)[*char_
])));
33 BOOST_TEST((test_attr("a b c d", skip(space
)[*char_
], s
)));
34 BOOST_TEST(s
== "abcd");
38 BOOST_TEST((test("ab c d", lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']], space
)));
39 BOOST_TEST((test("abcd", lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']], space
)));
40 BOOST_TEST(!(test("a bcd", lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']], space
)));
42 BOOST_TEST((test("ab c d", lexeme
[lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']]], space
)));
43 BOOST_TEST((test("abcd", lexeme
[lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']]], space
)));
44 BOOST_TEST(!(test("a bcd", lexeme
[lexeme
[lit('a') >> 'b' >> skip
[lit('c') >> 'd']]], space
)));
47 return boost::report_errors();