Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2011 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #if !defined(BOOST_SPIRIT_SKIP_APRIL_16_2006_0625PM)
|
Chris@16
|
8 #define BOOST_SPIRIT_SKIP_APRIL_16_2006_0625PM
|
Chris@16
|
9
|
Chris@16
|
10 #if defined(_MSC_VER)
|
Chris@16
|
11 #pragma once
|
Chris@16
|
12 #endif
|
Chris@16
|
13
|
Chris@16
|
14 #include <boost/spirit/home/support/unused.hpp>
|
Chris@16
|
15 #include <boost/spirit/home/qi/detail/unused_skipper.hpp>
|
Chris@16
|
16
|
Chris@16
|
17 namespace boost { namespace spirit { namespace qi
|
Chris@16
|
18 {
|
Chris@16
|
19 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
20 // Move the /first/ iterator to the first non-matching position
|
Chris@16
|
21 // given a skip-parser. The function is a no-op if unused_type is
|
Chris@16
|
22 // passed as the skip-parser.
|
Chris@16
|
23 ///////////////////////////////////////////////////////////////////////////
|
Chris@16
|
24 template <typename Iterator, typename T>
|
Chris@16
|
25 inline void skip_over(Iterator& first, Iterator const& last, T const& skipper)
|
Chris@16
|
26 {
|
Chris@16
|
27 while (first != last && skipper.parse(first, last, unused, unused, unused))
|
Chris@16
|
28 /***/;
|
Chris@16
|
29 }
|
Chris@16
|
30
|
Chris@16
|
31 template <typename Iterator>
|
Chris@16
|
32 inline void skip_over(Iterator&, Iterator const&, unused_type)
|
Chris@16
|
33 {
|
Chris@16
|
34 }
|
Chris@16
|
35
|
Chris@16
|
36 template <typename Iterator, typename Skipper>
|
Chris@16
|
37 inline void skip_over(Iterator&, Iterator const&
|
Chris@16
|
38 , detail::unused_skipper<Skipper> const&)
|
Chris@16
|
39 {
|
Chris@16
|
40 }
|
Chris@16
|
41
|
Chris@16
|
42 }}}
|
Chris@16
|
43
|
Chris@16
|
44 #endif
|