Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:49

0001 #ifndef BOOST_METAPARSE_V1_FAIL_AT_FIRST_CHAR_EXPECTED_HPP
0002 #define BOOST_METAPARSE_V1_FAIL_AT_FIRST_CHAR_EXPECTED_HPP
0003 
0004 // Copyright Abel Sinkovics (abel@sinkovics.hu)  2015.
0005 // Distributed under the Boost Software License, Version 1.0.
0006 //    (See accompanying file LICENSE_1_0.txt or copy at
0007 //          http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/metaparse/v1/impl/void_.hpp>
0010 #include <boost/metaparse/v1/accept.hpp>
0011 #include <boost/metaparse/v1/reject.hpp>
0012 #include <boost/metaparse/v1/is_error.hpp>
0013 #include <boost/metaparse/v1/get_position.hpp>
0014 
0015 #include <boost/metaparse/v1/error/expected_to_fail.hpp>
0016 
0017 #include <boost/mpl/eval_if.hpp>
0018 #include <boost/mpl/equal_to.hpp>
0019 
0020 namespace boost
0021 {
0022   namespace metaparse
0023   {
0024     namespace v1
0025     {
0026       template <class P>
0027       struct fail_at_first_char_expected
0028       {
0029       private:
0030         template <class S, class Pos>
0031         struct apply_err :
0032           boost::mpl::eval_if<
0033             typename boost::mpl::equal_to<
0034               Pos,
0035               typename get_position<typename P::template apply<S, Pos> >::type
0036             >::type,
0037             accept<impl::void_, S, Pos>,
0038             typename P::template apply<S, Pos>
0039           >
0040         {};
0041       public:
0042         typedef fail_at_first_char_expected type;
0043 
0044         template <class S, class Pos>
0045         struct apply :
0046           boost::mpl::eval_if<
0047             typename is_error<typename P::template apply<S, Pos> >::type,
0048             apply_err<S, Pos>,
0049             reject<error::expected_to_fail, Pos>
0050           >
0051         {};
0052       };
0053     }
0054   }
0055 }
0056 
0057 #endif
0058