1 ///////////////////////////////////////////////////////////////////////////////
2 // mark_end_matcher.hpp
4 // Copyright 2008 Eric Niebler. Distributed under the Boost
5 // Software License, Version 1.0. (See accompanying file
6 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
8 #ifndef BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_MARK_END_MATCHER_HPP_EAN_10_04_2005
9 #define BOOST_XPRESSIVE_DETAIL_CORE_MATCHER_MARK_END_MATCHER_HPP_EAN_10_04_2005
11 // MS compatible compilers support #pragma once
16 #include <boost/xpressive/detail/detail_fwd.hpp>
17 #include <boost/xpressive/detail/core/quant_style.hpp>
18 #include <boost/xpressive/detail/core/state.hpp>
20 namespace boost { namespace xpressive { namespace detail
23 ///////////////////////////////////////////////////////////////////////////////
26 struct mark_end_matcher
27 : quant_style<quant_none, 0, false>
31 mark_end_matcher(int mark_number)
32 : mark_number_(mark_number)
36 template<typename BidiIter, typename Next>
37 bool match(match_state<BidiIter> &state, Next const &next) const
39 sub_match_impl<BidiIter> &br = state.sub_match(this->mark_number_);
41 BidiIter old_first = br.first;
42 BidiIter old_second = br.second;
43 bool old_matched = br.matched;
46 br.second = state.cur_;
55 br.second = old_second;
56 br.matched = old_matched;