Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54852 - in trunk/boost/spirit/home/qi: . string string/detail
From: joel_at_[hidden]
Date: 2009-07-09 23:10:46


Author: djowel
Date: 2009-07-09 23:10:45 EDT (Thu, 09 Jul 2009)
New Revision: 54852
URL: http://svn.boost.org/trac/boost/changeset/54852

Log:
updates
Text files modified:
   trunk/boost/spirit/home/qi/parser.hpp | 2 +-
   trunk/boost/spirit/home/qi/string/detail/tst.hpp | 9 +++------
   trunk/boost/spirit/home/qi/string/symbols.hpp | 14 ++++++++++++++
   trunk/boost/spirit/home/qi/string/tst.hpp | 2 +-
   4 files changed, 19 insertions(+), 8 deletions(-)

Modified: trunk/boost/spirit/home/qi/parser.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/parser.hpp (original)
+++ trunk/boost/spirit/home/qi/parser.hpp 2009-07-09 23:10:45 EDT (Thu, 09 Jul 2009)
@@ -31,7 +31,7 @@
         // skip: skipper (can be unused_type)
         // attr: attribute (can be unused_type)
 
- // Requirement: p.what(context) -> void
+ // Requirement: p.what(context) -> info
         //
         // p: a parser
         // context: enclosing rule context (can be unused_type)

Modified: trunk/boost/spirit/home/qi/string/detail/tst.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/string/detail/tst.hpp (original)
+++ trunk/boost/spirit/home/qi/string/detail/tst.hpp 2009-07-09 23:10:45 EDT (Thu, 09 Jul 2009)
@@ -105,7 +105,7 @@
         }
 
         template <typename Iterator, typename Alloc>
- static bool
+ static T*
         add(
             tst_node*& start
           , Iterator first
@@ -114,7 +114,7 @@
           , Alloc* alloc)
         {
             if (first == last)
- return false;
+ return 0;
 
             tst_node** pp = &start;
             while (true)
@@ -132,11 +132,8 @@
                     if (++first == last)
                     {
                         if (p->data == 0)
- {
                             p->data = alloc->new_data(val);
- return true;
- }
- return false;
+ return p->data;
                     }
                     pp = &p->eq;
                 }

Modified: trunk/boost/spirit/home/qi/string/symbols.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/string/symbols.hpp (original)
+++ trunk/boost/spirit/home/qi/string/symbols.hpp 2009-07-09 23:10:45 EDT (Thu, 09 Jul 2009)
@@ -179,6 +179,20 @@
         {
             lookup->for_each(f);
         }
+
+ template <typename Str>
+ value_type& at(Str const& str)
+ {
+ return *lookup->add(traits::get_begin<Char>(str)
+ , traits::get_end<Char>(str), T());
+ }
+
+ template <typename Str>
+ value_type* find(Str const& str)
+ {
+ return lookup->find(traits::get_begin<Char>(str)
+ , traits::get_end<Char>(str), T());
+ }
 
         template <typename Iterator, typename Context
           , typename Skipper, typename Attribute>

Modified: trunk/boost/spirit/home/qi/string/tst.hpp
==============================================================================
--- trunk/boost/spirit/home/qi/string/tst.hpp (original)
+++ trunk/boost/spirit/home/qi/string/tst.hpp 2009-07-09 23:10:45 EDT (Thu, 09 Jul 2009)
@@ -65,7 +65,7 @@
         }
 
         template <typename Iterator>
- bool add(
+ T* add(
             Iterator first
           , Iterator last
           , typename boost::call_traits<T>::param_type val)


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