1 #ifndef BOOST_METAPARSE_V1_ONE_CHAR_HPP
2 #define BOOST_METAPARSE_V1_ONE_CHAR_HPP
4 // Copyright Abel Sinkovics (abel@sinkovics.hu) 2009 - 2011.
5 // Distributed under the Boost Software License, Version 1.0.
6 // (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/metaparse/v1/error/unexpected_end_of_input.hpp>
10 #include <boost/metaparse/v1/next_char.hpp>
11 #include <boost/metaparse/v1/next_line.hpp>
12 #include <boost/metaparse/v1/accept.hpp>
13 #include <boost/metaparse/v1/reject.hpp>
14 #include <boost/metaparse/v1/get_prev_char.hpp>
16 #include <boost/mpl/empty.hpp>
17 #include <boost/mpl/eval_if.hpp>
18 #include <boost/mpl/front.hpp>
19 #include <boost/mpl/pop_front.hpp>
20 #include <boost/mpl/bool.hpp>
31 template <class C, class Pos>
35 C::type::value == '\r'
37 C::type::value == '\n'
38 && get_prev_char<Pos>::type::value != '\r'
46 template <class S, class NextPos>
49 typename boost::mpl::front<S>::type,
50 boost::mpl::pop_front<S>,
55 typedef one_char type;
57 template <class S, class Pos>
60 typename boost::mpl::empty<S>::type,
61 reject<error::unexpected_end_of_input, Pos>,
62 unchecked<S, next_pos<boost::mpl::front<S>, Pos> >