Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r55912 - in trunk/tools/quickbook: . detail
From: daniel_james_at_[hidden]
Date: 2009-08-31 07:37:48


Author: danieljames
Date: 2009-08-31 07:37:48 EDT (Mon, 31 Aug 2009)
New Revision: 55912
URL: http://svn.boost.org/trac/boost/changeset/55912

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

Modified: trunk/tools/quickbook/block.hpp
==============================================================================
--- trunk/tools/quickbook/block.hpp (original)
+++ trunk/tools/quickbook/block.hpp 2009-08-31 07:37:48 EDT (Mon, 31 Aug 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: trunk/tools/quickbook/detail/actions.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.cpp (original)
+++ trunk/tools/quickbook/detail/actions.cpp 2009-08-31 07:37:48 EDT (Mon, 31 Aug 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: trunk/tools/quickbook/detail/actions.hpp
==============================================================================
--- trunk/tools/quickbook/detail/actions.hpp (original)
+++ trunk/tools/quickbook/detail/actions.hpp 2009-08-31 07:37:48 EDT (Mon, 31 Aug 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: trunk/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- trunk/tools/quickbook/detail/actions_class.cpp (original)
+++ trunk/tools/quickbook/detail/actions_class.cpp 2009-08-31 07:37:48 EDT (Mon, 31 Aug 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: trunk/tools/quickbook/detail/actions_class.hpp
==============================================================================
--- trunk/tools/quickbook/detail/actions_class.hpp (original)
+++ trunk/tools/quickbook/detail/actions_class.hpp 2009-08-31 07:37:48 EDT (Mon, 31 Aug 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