Boost logo

Boost-Commit :

From: eric_at_[hidden]
Date: 2007-11-29 12:38:25


Author: eric_niebler
Date: 2007-11-29 12:38:25 EST (Thu, 29 Nov 2007)
New Revision: 41466
URL: http://svn.boost.org/trac/boost/changeset/41466

Log:
support keep(), before(), after(), ~before() and ~after()
Text files modified:
   branches/proto/v3/boost/xpressive/detail/detail_fwd.hpp | 7 +++-
   branches/proto/v3/boost/xpressive/detail/static/grammar2.hpp | 56 +++++++++++++++++++++++++++++++++++-----
   2 files changed, 54 insertions(+), 9 deletions(-)

Modified: branches/proto/v3/boost/xpressive/detail/detail_fwd.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/detail_fwd.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/detail_fwd.hpp 2007-11-29 12:38:25 EST (Thu, 29 Nov 2007)
@@ -384,8 +384,11 @@
     };
     #endif
 
- struct greedy_t : mpl::true_ {};
- struct non_greedy_t : mpl::false_ {};
+ struct true_ : mpl::true_ {};
+ struct false_ : mpl::false_ {};
+
+ typedef true_ greedy_t;
+ typedef false_ non_greedy_t;
 
 }}} // namespace boost::xpressive::detail
 

Modified: branches/proto/v3/boost/xpressive/detail/static/grammar2.hpp
==============================================================================
--- branches/proto/v3/boost/xpressive/detail/static/grammar2.hpp (original)
+++ branches/proto/v3/boost/xpressive/detail/static/grammar2.hpp 2007-11-29 12:38:25 EST (Thu, 29 Nov 2007)
@@ -52,13 +52,6 @@
     struct is_aggregate<xpressive::detail::mark_placeholder>
       : mpl::true_
     {};
-
- // work around gcc bug.
- template<unsigned int Min, unsigned int Max>
- struct transform_category<xpressive::detail::generic_quant_tag<Min, Max> >
- {
- typedef no_transform type;
- };
 }}
 
 namespace boost { namespace xpressive
@@ -544,6 +537,55 @@
             struct case_<tag::comma, Dummy>
               : when<ListSet<Char>, as_list_set>
             {};
+
+ template<typename Dummy>
+ struct case_<keeper_tag, Dummy>
+ : when<
+ unary_expr<keeper_tag, Gram>
+ , keeper_matcher<as_independent(_arg)>(as_independent(_arg))
+ >
+ {};
+
+ template<typename Dummy>
+ struct case_<lookahead_tag, Dummy>
+ : when<
+ unary_expr<lookahead_tag, Gram>
+ , lookahead_matcher<as_independent(_arg)>(as_independent(_arg), false_())
+ >
+ {};
+
+ template<typename Dummy>
+ struct case_<lookbehind_tag, Dummy>
+ : when<
+ unary_expr<lookbehind_tag, Gram>
+ , lookbehind_matcher<as_independent(_arg)>(
+ as_independent(_arg)
+ , get_width(as_independent(_arg))
+ , false_()
+ )
+ >
+ {};
+
+ template<typename Dummy>
+ struct case_<tag::complement, Dummy>
+ : or_<
+ when<
+ complement<unary_expr<lookahead_tag, Gram> >
+ , lookahead_matcher<as_independent(_arg(_arg))>(
+ as_independent(_arg(_arg))
+ , true_()
+ )
+ >
+ , when<
+ complement<unary_expr<lookbehind_tag, Gram> >
+ , lookbehind_matcher<as_independent(_arg(_arg))>(
+ as_independent(_arg(_arg))
+ , get_width(as_independent(_arg(_arg)))
+ , true_()
+ )
+ >
+ >
+ {};
         };
 
     } // namespace detail


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk