aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/pegtl/internal/crlf_eol.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/pegtl/internal/crlf_eol.hpp')
-rw-r--r--MoonParser/pegtl/internal/crlf_eol.hpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/crlf_eol.hpp b/MoonParser/pegtl/internal/crlf_eol.hpp
new file mode 100644
index 0000000..621b6b3
--- /dev/null
+++ b/MoonParser/pegtl/internal/crlf_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_CRLF_EOL_HPP
5#define TAOCPP_PEGTL_INCLUDE_INTERNAL_CRLF_EOL_HPP
6
7#include "../config.hpp"
8
9namespace tao
10{
11 namespace TAOCPP_PEGTL_NAMESPACE
12 {
13 namespace internal
14 {
15 struct crlf_eol
16 {
17 static constexpr int ch = '\n';
18
19 template< typename Input >
20 static eol_pair match( Input& in )
21 {
22 eol_pair p = { false, in.size( 2 ) };
23 if( p.second > 1 ) {
24 if( ( in.peek_char() == '\r' ) && ( in.peek_char( 1 ) == '\n' ) ) {
25 in.bump_to_next_line( 2 );
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