Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53735 - in branches/quickbook-1.5: . detail
From: daniel_james_at_[hidden]
Date: 2009-06-07 16:34:38


Author: danieljames
Date: 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
New Revision: 53735
URL: http://svn.boost.org/trac/boost/changeset/53735

Log:
Introduce temporary id variable.
Text files modified:
   branches/quickbook-1.5/block.hpp | 6 +++---
   branches/quickbook-1.5/detail/actions.cpp | 5 +++--
   branches/quickbook-1.5/detail/actions.hpp | 7 +++++--
   branches/quickbook-1.5/detail/actions_class.cpp | 3 ++-
   branches/quickbook-1.5/detail/actions_class.hpp | 1 +
   5 files changed, 14 insertions(+), 8 deletions(-)

Modified: branches/quickbook-1.5/block.hpp
==============================================================================
--- branches/quickbook-1.5/block.hpp (original)
+++ branches/quickbook-1.5/block.hpp 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
@@ -129,11 +129,11 @@
>> ( ':' >>
                             (
                             if_p(qbk_since(105u)) [space]
- >> (+(alnum_p | '_')) [assign_a(actions.section_id)]
+ >> (+(alnum_p | '_')) [assign_a(actions.element_id)]
                             | eps_p [actions.section_warning]
- [assign_a(actions.section_id)]
+ [assign_a(actions.element_id)]
                             )
- | eps_p [assign_a(actions.section_id)]
+ | eps_p [assign_a(actions.element_id)]
                         )
>> phrase [actions.begin_section]
                     ;

Modified: branches/quickbook-1.5/detail/actions.cpp
==============================================================================
--- branches/quickbook-1.5/detail/actions.cpp (original)
+++ branches/quickbook-1.5/detail/actions.cpp 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
@@ -897,8 +897,9 @@
 
     void begin_section_action::operator()(iterator first, iterator last) const
     {
- if (section_id.empty())
- section_id = detail::make_identifier(first, last);
+ section_id = element_id.empty() ?
+ detail::make_identifier(first, last) :
+ element_id;
 
         if (section_level != 0)
             qualified_section_id += '.';

Modified: branches/quickbook-1.5/detail/actions.hpp
==============================================================================
--- branches/quickbook-1.5/detail/actions.hpp (original)
+++ branches/quickbook-1.5/detail/actions.hpp 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
@@ -668,13 +668,15 @@
           , std::string& library_id
           , std::string& section_id
           , int& section_level
- , std::string& qualified_section_id)
+ , std::string& qualified_section_id
+ , std::string& element_id)
         : out(out)
         , phrase(phrase)
         , library_id(library_id)
         , section_id(section_id)
         , section_level(section_level)
- , qualified_section_id(qualified_section_id) {}
+ , qualified_section_id(qualified_section_id)
+ , element_id(element_id) {}
 
         void operator()(iterator first, iterator last) const;
 
@@ -684,6 +686,7 @@
         std::string& section_id;
         int& section_level;
         std::string& qualified_section_id;
+ std::string& element_id;
     };
 
     struct end_section_action

Modified: branches/quickbook-1.5/detail/actions_class.cpp
==============================================================================
--- branches/quickbook-1.5/detail/actions_class.cpp (original)
+++ branches/quickbook-1.5/detail/actions_class.cpp 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
@@ -52,6 +52,7 @@
         , source_mode("c++")
 
     // temporary or global state
+ , element_id()
         , table_title()
         , table_span(0)
         , table_header()
@@ -166,7 +167,7 @@
         , end_cell(phrase, temp_para)
         , anchor(out)
 
- , begin_section(out, phrase, doc_id, section_id, section_level, qualified_section_id)
+ , begin_section(out, phrase, doc_id, section_id, section_level, qualified_section_id, element_id)
         , end_section(out, section_level, qualified_section_id, error_count)
         , xinclude(out, *this)
         , include(*this)

Modified: branches/quickbook-1.5/detail/actions_class.hpp
==============================================================================
--- branches/quickbook-1.5/detail/actions_class.hpp (original)
+++ branches/quickbook-1.5/detail/actions_class.hpp 2009-06-07 16:34:37 EDT (Sun, 07 Jun 2009)
@@ -79,6 +79,7 @@
         std::stack<state_tuple> state_stack;
 
     // temporary or global state
+ std::string element_id;
         std::string table_title;
         unsigned table_span;
         std::string table_header;


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