aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/pegtl/internal/bytes.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/pegtl/internal/bytes.hpp')
-rw-r--r--MoonParser/pegtl/internal/bytes.hpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/MoonParser/pegtl/internal/bytes.hpp b/MoonParser/pegtl/internal/bytes.hpp
new file mode 100644
index 0000000..c180a68
--- /dev/null
+++ b/MoonParser/pegtl/internal/bytes.hpp
@@ -0,0 +1,46 @@
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_BYTES_HPP
5#define TAOCPP_PEGTL_INCLUDE_INTERNAL_BYTES_HPP
6
7#include "../config.hpp"
8
9#include "skip_control.hpp"
10
11#include "../analysis/counted.hpp"
12
13namespace tao
14{
15 namespace TAOCPP_PEGTL_NAMESPACE
16 {
17 namespace internal
18 {
19 template< unsigned Num >
20 struct bytes
21 {
22 using analyze_t = analysis::counted< analysis::rule_type::ANY, Num >;
23
24 template< typename Input >
25 static bool match( Input& in )
26 {
27 if( in.size( Num ) >= Num ) {
28 in.bump( Num );
29 return true;
30 }
31 return false;
32 }
33 };
34
35 template< unsigned Num >
36 struct skip_control< bytes< Num > > : std::true_type
37 {
38 };
39
40 } // namespace internal
41
42 } // namespace TAOCPP_PEGTL_NAMESPACE
43
44} // namespace tao
45
46#endif