diff options
Diffstat (limited to 'MoonParser/pegtl/internal/raise.hpp')
-rw-r--r-- | MoonParser/pegtl/internal/raise.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/raise.hpp b/MoonParser/pegtl/internal/raise.hpp new file mode 100644 index 0000000..d183ce0 --- /dev/null +++ b/MoonParser/pegtl/internal/raise.hpp | |||
@@ -0,0 +1,57 @@ | |||
1 | // Copyright (c) 2014-2017 Dr. Colin Hirsch and Daniel Frey | ||
2 | // Please see LICENSE for license or visit https://github.com/taocpp/PEGTL/ | ||
3 | |||
4 | #ifndef TAOCPP_PEGTL_INCLUDE_INTERNAL_RAISE_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_INTERNAL_RAISE_HPP | ||
6 | |||
7 | #include <cstdlib> | ||
8 | #include <type_traits> | ||
9 | |||
10 | #include "../config.hpp" | ||
11 | |||
12 | #include "skip_control.hpp" | ||
13 | |||
14 | #include "../analysis/generic.hpp" | ||
15 | #include "../apply_mode.hpp" | ||
16 | #include "../rewind_mode.hpp" | ||
17 | |||
18 | namespace tao | ||
19 | { | ||
20 | namespace TAOCPP_PEGTL_NAMESPACE | ||
21 | { | ||
22 | namespace internal | ||
23 | { | ||
24 | template< typename T > | ||
25 | struct raise | ||
26 | { | ||
27 | using analyze_t = analysis::generic< analysis::rule_type::ANY >; | ||
28 | |||
29 | template< apply_mode, | ||
30 | rewind_mode, | ||
31 | template< typename... > class Action, | ||
32 | template< typename... > class Control, | ||
33 | typename Input, | ||
34 | typename... States > | ||
35 | static bool match( Input& in, States&&... st ) | ||
36 | { | ||
37 | Control< T >::raise( const_cast< const Input& >( in ), st... ); | ||
38 | #if defined( _MSC_VER ) | ||
39 | __assume( false ); // LCOV_EXCL_LINE | ||
40 | #else | ||
41 | std::abort(); // LCOV_EXCL_LINE | ||
42 | #endif | ||
43 | } | ||
44 | }; | ||
45 | |||
46 | template< typename T > | ||
47 | struct skip_control< raise< T > > : std::true_type | ||
48 | { | ||
49 | }; | ||
50 | |||
51 | } // namespace internal | ||
52 | |||
53 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
54 | |||
55 | } // namespace tao | ||
56 | |||
57 | #endif | ||