Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/generic/include/boost/spirit/home/x3/char/char_parser.hpp @ 102:f46d142149f5
Whoops, finish that update
author | Chris Cannam |
---|---|
date | Mon, 07 Sep 2015 11:13:41 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
101:c530137014c0 | 102:f46d142149f5 |
---|---|
1 /*============================================================================= | |
2 Copyright (c) 2001-2014 Joel de Guzman | |
3 | |
4 Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 ==============================================================================*/ | |
7 #if !defined(BOOST_SPIRIT_X3_CHAR_PARSER_APR_16_2006_0906AM) | |
8 #define BOOST_SPIRIT_X3_CHAR_PARSER_APR_16_2006_0906AM | |
9 | |
10 #if defined(_MSC_VER) | |
11 #pragma once | |
12 #endif | |
13 | |
14 #include <boost/spirit/home/x3/core/parser.hpp> | |
15 #include <boost/spirit/home/x3/core/skip_over.hpp> | |
16 #include <boost/spirit/home/x3/support/traits/move_to.hpp> | |
17 | |
18 namespace boost { namespace spirit { namespace x3 | |
19 { | |
20 /////////////////////////////////////////////////////////////////////////// | |
21 // The base char_parser | |
22 /////////////////////////////////////////////////////////////////////////// | |
23 template <typename Derived> | |
24 struct char_parser : parser<Derived> | |
25 { | |
26 template <typename Iterator, typename Context, typename Attribute> | |
27 bool parse( | |
28 Iterator& first, Iterator const& last | |
29 , Context const& context, unused_type, Attribute& attr) const | |
30 { | |
31 x3::skip_over(first, last, context); | |
32 | |
33 if (first != last && this->derived().test(*first, context)) | |
34 { | |
35 x3::traits::move_to(*first, attr); | |
36 ++first; | |
37 return true; | |
38 } | |
39 return false; | |
40 } | |
41 }; | |
42 }}} | |
43 | |
44 #endif |