Coverage Report

Created: 2023-11-27 07:13

/src/usbguard/src/ThirdParty/PEGTL/include/tao/pegtl/parse.hpp
Line
Count
Source
1
// Copyright (c) 2014-2021 Dr. Colin Hirsch and Daniel Frey
2
// Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/
3
4
#ifndef TAO_PEGTL_PARSE_HPP
5
#define TAO_PEGTL_PARSE_HPP
6
7
#include <type_traits>
8
9
#include "apply_mode.hpp"
10
#include "config.hpp"
11
#include "normal.hpp"
12
#include "nothing.hpp"
13
#include "parse_error.hpp"
14
#include "position.hpp"
15
#include "rewind_mode.hpp"
16
17
namespace TAO_PEGTL_NAMESPACE
18
{
19
   namespace internal
20
   {
21
      [[nodiscard]] inline auto get_position( const position& p ) noexcept( std::is_nothrow_copy_constructible_v< position > )
22
      {
23
         return p;
24
      }
25
26
      template< typename ParseInput >
27
      [[nodiscard]] position get_position( const ParseInput& in ) noexcept( noexcept( position( in.position() ) ) )
28
      {
29
         return in.position();
30
      }
31
32
   }  // namespace internal
33
34
   template< typename Rule,
35
             template< typename... > class Action = nothing,
36
             template< typename... > class Control = normal,
37
             apply_mode A = apply_mode::action,
38
             rewind_mode M = rewind_mode::required,
39
             typename ParseInput,
40
             typename... States >
41
   auto parse( ParseInput&& in, States&&... st )
42
36.7k
   {
43
36.7k
      return Control< Rule >::template match< A, M, Action, Control >( in, st... );
44
36.7k
   }
auto tao::pegtl::parse<usbguard::RuleParser::rule_grammar, usbguard::RuleParser::rule_parser_actions, tao::pegtl::normal, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::Rule&>(tao::pegtl::string_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> > >&, usbguard::Rule&)
Line
Count
Source
42
35.4k
   {
43
35.4k
      return Control< Rule >::template match< A, M, Action, Control >( in, st... );
44
35.4k
   }
Unexecuted instantiation: auto tao::pegtl::parse<usbguard::RuleParser::rule_grammar, usbguard::RuleParser::rule_parser_actions, tao::pegtl::state_control<tao::pegtl::normal>::type, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::Rule&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&>(tao::pegtl::string_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> > >&, usbguard::Rule&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&)
Unexecuted instantiation: auto tao::pegtl::parse<usbguard::UEventParser::attributes, usbguard::UEventParser::actions, tao::pegtl::normal, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::UEvent&>(tao::pegtl::string_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> > >&, usbguard::UEvent&)
Unexecuted instantiation: auto tao::pegtl::parse<usbguard::UEventParser::attributes, usbguard::UEventParser::actions, tao::pegtl::state_control<tao::pegtl::normal>::type, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::UEvent&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&>(tao::pegtl::string_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> > >&, usbguard::UEvent&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&)
auto tao::pegtl::parse<usbguard::UEventParser::grammar, usbguard::UEventParser::actions, tao::pegtl::normal, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::UEvent&>(tao::pegtl::string_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> > >&, usbguard::UEvent&)
Line
Count
Source
42
1.25k
   {
43
1.25k
      return Control< Rule >::template match< A, M, Action, Control >( in, st... );
44
1.25k
   }
Unexecuted instantiation: auto tao::pegtl::parse<usbguard::UEventParser::grammar, usbguard::UEventParser::actions, tao::pegtl::state_control<tao::pegtl::normal>::type, (tao::pegtl::apply_mode)1, (tao::pegtl::rewind_mode)1, tao::pegtl::string_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> > >&, usbguard::UEvent&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&>(tao::pegtl::string_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> > >&, usbguard::UEvent&, tao::pegtl::tracer<tao::pegtl::tracer_traits<false, true, 2ul, 8ul> >&)
45
46
   template< typename Rule,
47
             template< typename... > class Action = nothing,
48
             template< typename... > class Control = normal,
49
             apply_mode A = apply_mode::action,
50
             rewind_mode M = rewind_mode::required,
51
             typename Outer,
52
             typename ParseInput,
53
             typename... States >
54
   auto parse_nested( const Outer& o, ParseInput&& in, States&&... st )
55
   {
56
#if defined( __cpp_exceptions )
57
      try {
58
         return parse< Rule, Action, Control, A, M >( in, st... );
59
      }
60
      catch( parse_error& e ) {
61
         e.add_position( internal::get_position( o ) );
62
         throw;
63
      }
64
#else
65
      (void)o;
66
      return parse< Rule, Action, Control, A, M >( in, st... );
67
#endif
68
   }
69
70
}  // namespace TAO_PEGTL_NAMESPACE
71
72
#endif