Boost logo

Boost-Commit :

From: joel_at_[hidden]
Date: 2008-04-18 17:03:53


Author: djowel
Date: 2008-04-18 17:03:53 EDT (Fri, 18 Apr 2008)
New Revision: 44558
URL: http://svn.boost.org/trac/boost/changeset/44558

Log:
fixed rule accepting any type of skipper but doing nothing
Text files modified:
   trunk/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp | 2 +-
   trunk/boost/spirit/home/qi/nonterminal/detail/rule.hpp | 11 +++++++++--
   trunk/boost/spirit/home/qi/nonterminal/rule.hpp | 8 ++++----
   3 files changed, 14 insertions(+), 7 deletions(-)

Modified: trunk/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/detail/error_handler.hpp 2008-04-18 17:03:53 EDT (Fri, 18 Apr 2008)
@@ -87,7 +87,7 @@
             Iterator& first
           , Iterator const& last
           , Context& context
- , unused_type)
+ , accept_unused_only)
         {
             return parse_main(first, last, context, unused);
         }

Modified: trunk/boost/spirit/home/qi/nonterminal/detail/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/detail/rule.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/detail/rule.hpp 2008-04-18 17:03:53 EDT (Fri, 18 Apr 2008)
@@ -21,6 +21,13 @@
 
 namespace boost { namespace spirit { namespace qi { namespace detail
 {
+ struct accept_unused_only
+ {
+ // this struct accepts only unused types and
+ // nothing else.
+ accept_unused_only(unused_type) {}
+ };
+
     template <typename Iterator, typename Context, typename Skipper>
     struct virtual_component_base
     {
@@ -55,7 +62,7 @@
             Iterator& first
           , Iterator const& last
           , Context& context
- , unused_type) = 0;
+ , accept_unused_only) = 0;
 
         boost::detail::atomic_count use_count;
     };
@@ -184,7 +191,7 @@
             Iterator& first
           , Iterator const& last
           , Context& context
- , unused_type)
+ , accept_unused_only)
         {
             return parse_main(first, last, context, unused, Auto());
         }

Modified: trunk/boost/spirit/home/qi/nonterminal/rule.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/nonterminal/rule.hpp (original)
+++ trunk/boost/spirit/home/qi/nonterminal/rule.hpp 2008-04-18 17:03:53 EDT (Fri, 18 Apr 2008)
@@ -209,7 +209,7 @@
             static call(Rule& r, A1 const& a1)
             {
                 typename Rule::pointer_type old (r.ptr);
- r.ptr.reset(new Decorator(r.ptr, a1));
+ r.ptr.reset(new Decorator(r.ptr, a1));
                 return old;
             }
 
@@ -362,11 +362,11 @@
     // forward declaration only
     template <typename Parser, typename Skipper>
     struct skipper_is_compatible;
-
+
     // If the parser is a rule, then the skipper must be convertible to
- // the skipper used with this rule.
+ // the skipper used with this rule.
     template <
- typename Iterator, typename T0, typename T1, typename T2,
+ typename Iterator, typename T0, typename T1, typename T2,
         typename Skipper
>
     struct skipper_is_compatible<qi::rule<Iterator, T0, T1, T2>, Skipper>


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