| 1 | /*============================================================================= |
| 2 | Copyright (c) 2001-2011 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_SKIP_APRIL_16_2006_0625PM) |
| 8 | #define BOOST_SPIRIT_SKIP_APRIL_16_2006_0625PM |
| 9 | |
| 10 | #if defined(_MSC_VER) |
| 11 | #pragma once |
| 12 | #endif |
| 13 | |
| 14 | #include <boost/spirit/home/support/unused.hpp> |
| 15 | #include <boost/spirit/home/qi/detail/unused_skipper.hpp> |
| 16 | |
| 17 | namespace boost { namespace spirit { namespace qi |
| 18 | { |
| 19 | /////////////////////////////////////////////////////////////////////////// |
| 20 | // Move the /first/ iterator to the first non-matching position |
| 21 | // given a skip-parser. The function is a no-op if unused_type is |
| 22 | // passed as the skip-parser. |
| 23 | /////////////////////////////////////////////////////////////////////////// |
| 24 | template <typename Iterator, typename T> |
| 25 | inline void skip_over(Iterator& first, Iterator const& last, T const& skipper) |
| 26 | { |
| 27 | while (skipper.parse(first, last, unused, unused, unused)) |
| 28 | /***/; |
| 29 | } |
| 30 | |
| 31 | template <typename Iterator> |
| 32 | inline void skip_over(Iterator&, Iterator const&, unused_type) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | template <typename Iterator, typename Skipper> |
| 37 | inline void skip_over(Iterator&, Iterator const& |
| 38 | , detail::unused_skipper<Skipper> const&) |
| 39 | { |
| 40 | } |
| 41 | |
| 42 | }}} |
| 43 | |
| 44 | #endif |
| 45 | |