Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76640 - branches/quickbook-dev/tools/quickbook/src
From: dnljms_at_[hidden]
Date: 2012-01-22 18:04:30


Author: danieljames
Date: 2012-01-22 18:04:29 EST (Sun, 22 Jan 2012)
New Revision: 76640
URL: http://svn.boost.org/trac/boost/changeset/76640

Log:
Quickbook: Remove some cruft from `value_builder`.

Wasn't really used and didn't really work.
Text files modified:
   branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp | 2 +-
   branches/quickbook-dev/tools/quickbook/src/values.cpp | 23 +++++++++++------------
   branches/quickbook-dev/tools/quickbook/src/values.hpp | 6 ++++--
   3 files changed, 16 insertions(+), 15 deletions(-)

Modified: branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp 2012-01-22 18:04:29 EST (Sun, 22 Jan 2012)
@@ -107,7 +107,7 @@
                         info_.type != element_info::maybe_block)
                     l.actions_.paragraph();
 
- l.actions_.values.builder.reset();
+ assert(l.actions_.values.builder.empty());
 
                 if (!l.actions_.source_mode_next.empty() &&
                     info_.type != element_info::maybe_block)

Modified: branches/quickbook-dev/tools/quickbook/src/values.cpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/values.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/values.cpp 2012-01-22 18:04:29 EST (Sun, 22 Jan 2012)
@@ -765,6 +765,11 @@
             back_ = merge_sort(&head_);
             assert(*back_ == &value_list_end_impl::instance);
         }
+
+ bool value_list_builder::empty() const
+ {
+ return head_ == &value_list_end_impl::instance;
+ }
     }
 
     //////////////////////////////////////////////////////////////////////////
@@ -799,16 +804,6 @@
         return value(new detail::value_list_impl(current, list_tag));
     }
 
- void value_builder::reset() {
- detail::value_list_builder new_builder;
- current.swap(new_builder);
- list_tag = value::default_tag;
- }
-
- void value_builder::set_tag(value::tag_type tag) {
- list_tag = tag;
- }
-
     void value_builder::insert(value const& item) {
         current.append(item.value_);
     }
@@ -822,9 +817,8 @@
     }
 
     void value_builder::start_list(value::tag_type tag) {
- value::tag_type saved_tag = tag;
         save();
- list_tag = saved_tag;
+ list_tag = tag;
     }
 
     void value_builder::finish_list() {
@@ -842,6 +836,11 @@
         current.sort();
     }
 
+ bool value_builder::empty() const
+ {
+ return current.empty();
+ }
+
     ////////////////////////////////////////////////////////////////////////////
     // Iterator
 

Modified: branches/quickbook-dev/tools/quickbook/src/values.hpp
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/values.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/values.hpp 2012-01-22 18:04:29 EST (Sun, 22 Jan 2012)
@@ -211,6 +211,8 @@
 
             void append(value_node*);
             void sort();
+
+ bool empty() const;
         private:
             value_node* head_;
             value_node** back_;
@@ -269,8 +271,6 @@
 
         value release();
 
- void reset();
- void set_tag(value::tag_type);
         void insert(value const&);
         void extend(value const&);
 
@@ -279,6 +279,8 @@
         void clear_list();
         void sort_list();
 
+ bool empty() const;
+
     private:
         detail::value_list_builder current;
         value::tag_type list_tag;


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