diff options
Diffstat (limited to 'MoonParser/pegtl/internal/cr_eol.hpp')
-rw-r--r-- | MoonParser/pegtl/internal/cr_eol.hpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/cr_eol.hpp b/MoonParser/pegtl/internal/cr_eol.hpp new file mode 100644 index 0000000..79388eb --- /dev/null +++ b/MoonParser/pegtl/internal/cr_eol.hpp | |||
@@ -0,0 +1,39 @@ | |||
1 | // Copyright (c) 2016-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_CR_EOL_HPP | ||
5 | #define TAOCPP_PEGTL_INCLUDE_INTERNAL_CR_EOL_HPP | ||
6 | |||
7 | #include "../config.hpp" | ||
8 | |||
9 | namespace tao | ||
10 | { | ||
11 | namespace TAOCPP_PEGTL_NAMESPACE | ||
12 | { | ||
13 | namespace internal | ||
14 | { | ||
15 | struct cr_eol | ||
16 | { | ||
17 | static constexpr int ch = '\r'; | ||
18 | |||
19 | template< typename Input > | ||
20 | static eol_pair match( Input& in ) | ||
21 | { | ||
22 | eol_pair p = { false, in.size( 1 ) }; | ||
23 | if( p.second ) { | ||
24 | if( in.peek_char() == '\r' ) { | ||
25 | in.bump_to_next_line(); | ||
26 | p.first = true; | ||
27 | } | ||
28 | } | ||
29 | return p; | ||
30 | } | ||
31 | }; | ||
32 | |||
33 | } // namespace internal | ||
34 | |||
35 | } // namespace TAOCPP_PEGTL_NAMESPACE | ||
36 | |||
37 | } // namespace tao | ||
38 | |||
39 | #endif | ||