/src/Fast-DDS/thirdparty/taocpp-pegtl/pegtl/internal/range.hpp
Line | Count | Source (jump to first uncovered line) |
1 | | // Copyright (c) 2014-2020 Dr. Colin Hirsch and Daniel Frey |
2 | | // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ |
3 | | |
4 | | #ifndef TAO_PEGTL_INTERNAL_RANGE_HPP |
5 | | #define TAO_PEGTL_INTERNAL_RANGE_HPP |
6 | | |
7 | | #include "../config.hpp" |
8 | | |
9 | | #include "bump_help.hpp" |
10 | | #include "result_on_found.hpp" |
11 | | #include "skip_control.hpp" |
12 | | |
13 | | #include "../analysis/generic.hpp" |
14 | | |
15 | | namespace tao |
16 | | { |
17 | | namespace TAO_PEGTL_NAMESPACE |
18 | | { |
19 | | namespace internal |
20 | | { |
21 | | template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi > |
22 | | struct range |
23 | | { |
24 | | static_assert( Lo <= Hi, "invalid range detected" ); |
25 | | |
26 | | using analyze_t = analysis::generic< analysis::rule_type::any >; |
27 | | |
28 | | template< int Eol > |
29 | | struct can_match_eol |
30 | | { |
31 | | static constexpr bool value = ( ( ( Lo <= Eol ) && ( Eol <= Hi ) ) == bool( R ) ); |
32 | | }; |
33 | | |
34 | | template< typename Input > |
35 | | static bool match( Input& in ) noexcept( noexcept( Peek::peek( in ) ) ) |
36 | 0 | { |
37 | 0 | if( const auto t = Peek::peek( in ) ) { |
38 | 0 | if( ( ( Lo <= t.data ) && ( t.data <= Hi ) ) == bool( R ) ) { |
39 | 0 | bump_impl< can_match_eol< Input::eol_t::ch >::value >::bump( in, t.size ); |
40 | 0 | return true; |
41 | 0 | } |
42 | 0 | } |
43 | 0 | return false; |
44 | 0 | } Unexecuted instantiation: bool tao::pegtl::internal::range<(tao::pegtl::internal::result_on_found)1, tao::pegtl::internal::peek_char, (char)48, (char)57>::match<tao::pegtl::memory_input<(tao::pegtl::tracking_mode)0, tao::pegtl::ascii::eol::lf_crlf, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(tao::pegtl::memory_input<(tao::pegtl::tracking_mode)0, tao::pegtl::ascii::eol::lf_crlf, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) Unexecuted instantiation: bool tao::pegtl::internal::range<(tao::pegtl::internal::result_on_found)1, tao::pegtl::internal::peek_char, (char)48, (char)55>::match<tao::pegtl::memory_input<(tao::pegtl::tracking_mode)0, tao::pegtl::ascii::eol::lf_crlf, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >(tao::pegtl::memory_input<(tao::pegtl::tracking_mode)0, tao::pegtl::ascii::eol::lf_crlf, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >&) |
45 | | }; |
46 | | |
47 | | template< result_on_found R, typename Peek, typename Peek::data_t Lo, typename Peek::data_t Hi > |
48 | | struct skip_control< range< R, Peek, Lo, Hi > > : std::true_type |
49 | | { |
50 | | }; |
51 | | |
52 | | } // namespace internal |
53 | | |
54 | | } // namespace TAO_PEGTL_NAMESPACE |
55 | | |
56 | | } // namespace tao |
57 | | |
58 | | #endif |