| 1 | /*============================================================================= |
|---|---|
| 2 | Copyright (c) 2001-2010 Hartmut Kaiser |
| 3 | |
| 4 | Distributed under the Boost Software License, Version 1.0. (See accompanying |
| 5 | file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | =============================================================================*/ |
| 7 | |
| 8 | #include <boost/spirit/include/qi_operator.hpp> |
| 9 | #include <boost/spirit/include/qi_char.hpp> |
| 10 | #include <boost/spirit/include/qi_numeric.hpp> |
| 11 | #include <boost/spirit/include/qi_nonterminal.hpp> |
| 12 | #include <boost/spirit/include/qi_parse.hpp> |
| 13 | |
| 14 | using namespace boost::spirit; |
| 15 | using namespace boost::spirit::qi; |
| 16 | |
| 17 | // this test must fail compiling |
| 18 | int main() |
| 19 | { |
| 20 | char const* input = "some input, it doesn't matter"; |
| 21 | char const* end = &input[strlen(s: input)]; |
| 22 | |
| 23 | rule<char const*, rule<char const*> > def; |
| 24 | def = int_ >> *(',' >> int_); |
| 25 | |
| 26 | phrase_parse(first&: input, last: end, expr: def, |
| 27 | skipper: qi::space | ('%' >> *~char_('\n') >> '\n')); |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 |
