Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59553 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-02-07 04:08:16


Author: danieljames
Date: 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
New Revision: 59553
URL: http://svn.boost.org/trac/boost/changeset/59553

Log:
Explicitly instantiate process separately from the grammars and
introduce a hook for generating the output separately.
Added:
   branches/quickbook-1.5-spirit2/process.cpp (contents, props changed)
   branches/quickbook-1.5-spirit2/syntax_highlight.hpp
      - copied, changed from r59552, /branches/quickbook-1.5-spirit2/code.hpp
Text files modified:
   branches/quickbook-1.5-spirit2/Jamfile.v2 | 1
   branches/quickbook-1.5-spirit2/actions.cpp | 1
   branches/quickbook-1.5-spirit2/actions.hpp | 4 --
   branches/quickbook-1.5-spirit2/block.hpp | 13 -----------
   branches/quickbook-1.5-spirit2/block_actions.cpp | 47 ++++++++++++++++++++++++++++-----------
   branches/quickbook-1.5-spirit2/block_list.cpp | 4 ++
   branches/quickbook-1.5-spirit2/code.hpp | 2
   branches/quickbook-1.5-spirit2/code_snippet_types.hpp | 2 -
   branches/quickbook-1.5-spirit2/fwd.hpp | 2 +
   branches/quickbook-1.5-spirit2/parse_types.hpp | 2
   branches/quickbook-1.5-spirit2/phrase.hpp | 10 --------
   branches/quickbook-1.5-spirit2/phrase_actions.cpp | 30 ++++++++++++++++---------
   branches/quickbook-1.5-spirit2/phrase_image.cpp | 4 ++
   branches/quickbook-1.5-spirit2/syntax_highlight.cpp | 5 +++
   branches/quickbook-1.5-spirit2/syntax_highlight.hpp | 24 ++++----------------
   branches/quickbook-1.5-spirit2/template.cpp | 12 +++++----
   branches/quickbook-1.5-spirit2/template.hpp | 2
   17 files changed, 81 insertions(+), 84 deletions(-)

Modified: branches/quickbook-1.5-spirit2/Jamfile.v2
==============================================================================
--- branches/quickbook-1.5-spirit2/Jamfile.v2 (original)
+++ branches/quickbook-1.5-spirit2/Jamfile.v2 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -19,6 +19,7 @@
 
 exe quickbook
     :
+ process.cpp
     quickbook.cpp
     actions.cpp
     actions_class.cpp

Modified: branches/quickbook-1.5-spirit2/actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/actions.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -9,7 +9,6 @@
     http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
 
-#include <boost/spirit/include/support_unused.hpp>
 #include "actions.hpp"
 #include "actions_class.hpp"
 #include "doc_info.hpp"

Modified: branches/quickbook-1.5-spirit2/actions.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions.hpp (original)
+++ branches/quickbook-1.5-spirit2/actions.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -200,9 +200,7 @@
         }
 
         template <typename T>
- void operator()(T const& x) const {
- process(actions, x);
- }
+ void operator()(T const& x) const;
         
         quickbook::actions& actions;
     };

Modified: branches/quickbook-1.5-spirit2/block.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block.hpp (original)
+++ branches/quickbook-1.5-spirit2/block.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -99,19 +99,6 @@
         boost::optional<std::string> id;
         std::string path;
     };
-
- void process(quickbook::actions&, hr);
- void process(quickbook::actions&, paragraph const&);
- void process(quickbook::actions&, list const&);
- void process(quickbook::actions&, begin_section const&);
- void process(quickbook::actions&, end_section const&);
- void process(quickbook::actions&, heading const&);
- void process(quickbook::actions&, def_macro const&);
- void process(quickbook::actions&, variablelist const&);
- void process(quickbook::actions&, table const&);
- void process(quickbook::actions&, xinclude const&);
- void process(quickbook::actions&, import const&);
- void process(quickbook::actions&, include const&);
 }
 
 #endif

Modified: branches/quickbook-1.5-spirit2/block_actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block_actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/block_actions.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -35,17 +35,19 @@
         }
     }
 
- void process(quickbook::actions& actions, hr)
+ nothing process(quickbook::actions& actions, hr)
     {
         actions.phrase << hr_;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, paragraph const& x)
+ nothing process(quickbook::actions& actions, paragraph const& x)
     {
         actions.phrase << paragraph_pre << x.content << paragraph_post;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, begin_section const& x)
+ nothing process(quickbook::actions& actions, begin_section const& x)
     {
         // TODO: This uses the generated title.
         actions.section_id = x.id ? *x.id :
@@ -94,10 +96,11 @@
                 << "</title>\n"
                 ;
         }
-
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, end_section const& x)
+ nothing process(quickbook::actions& actions, end_section const& x)
     {
         actions.phrase << "</section>";
 
@@ -122,9 +125,11 @@
             BOOST_ASSERT(std::string::npos != n);
             actions.qualified_section_id.erase(n, std::string::npos);
         }
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, heading const& x)
+ nothing process(quickbook::actions& actions, heading const& x)
     {
         // TODO: Is this right?
         bool new_style = qbk_version_n >= 103 || x.level > 0;
@@ -169,27 +174,31 @@
                 << "</bridgehead>"
                 ;
         }
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, def_macro const& x)
+ nothing process(quickbook::actions& actions, def_macro const& x)
     {
         actions.macro.add(
             x.macro_identifier.begin()
           , x.macro_identifier.end()
           , quickbook::macro(x.content));
-
+ return nothing();
     }
 
- void process(quickbook::actions& actions, define_template const& x)
+ nothing process(quickbook::actions& actions, define_template const& x)
     {
         if(!actions.templates.add(x)) {
             detail::outerr(x.position.file, x.position.line)
                 << "Template Redefinition: " << x.id << std::endl;
             ++actions.error_count;
         }
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, variablelist const& x)
+ nothing process(quickbook::actions& actions, variablelist const& x)
     {
         actions.phrase << "<variablelist>\n";
 
@@ -206,10 +215,12 @@
         }
 
         actions.phrase << "</variablelist>\n";
+
+ return nothing();
     }
 
 
- void process(quickbook::actions& actions, table const& x)
+ nothing process(quickbook::actions& actions, table const& x)
     {
         bool has_title = !x.title.empty();
         
@@ -285,6 +296,8 @@
         {
             actions.phrase << "</informaltable>\n";
         }
+
+ return nothing();
     }
 
     namespace
@@ -383,15 +396,17 @@
         }
     }
 
- void process(quickbook::actions& actions, xinclude const& x)
+ nothing process(quickbook::actions& actions, xinclude const& x)
     {
         fs::path path = calculate_relative_path(x.path, actions);
         actions.phrase << "\n<xi:include href=\"";
         detail::print_string(detail::escape_uri(path.string()), actions.phrase.get());
         actions.phrase << "\" />\n";
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, include const& x)
+ nothing process(quickbook::actions& actions, include const& x)
     {
         fs::path filein = include_search(actions.filename.branch_path(), x.path);
         std::string doc_id;
@@ -427,9 +442,11 @@
         actions.macro = macro;
         // restore the templates
         //~ actions.templates = templates; $$$ fixme $$$
+
+ return nothing();
     }
 
- void process(quickbook::actions& actions, import const& x)
+ nothing process(quickbook::actions& actions, import const& x)
     {
         fs::path path = include_search(actions.filename.branch_path(), x.path);
         std::string ext = fs::extension(path);
@@ -446,5 +463,7 @@
                 ++actions.error_count;
             }
         }
+
+ return nothing();
     }
 }
\ No newline at end of file

Modified: branches/quickbook-1.5-spirit2/block_list.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block_list.cpp (original)
+++ branches/quickbook-1.5-spirit2/block_list.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -36,7 +36,7 @@
         }
     }
 
- void process(quickbook::actions& actions, quickbook::list const& list)
+ nothing process(quickbook::actions& actions, quickbook::list const& list)
     {
         int list_indent = -1;
         std::stack<mark_type> list_marks;
@@ -94,5 +94,7 @@
             actions.phrase << std::string(list_marks.top().first == '#' ? "\n</orderedlist>" : "\n</itemizedlist>");
             list_marks.pop();
         }
+
+ return nothing();
     }
 }
\ No newline at end of file

Modified: branches/quickbook-1.5-spirit2/code.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/code.hpp (original)
+++ branches/quickbook-1.5-spirit2/code.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -22,7 +22,7 @@
         std::string code;
     };
     
- void process(quickbook::actions&, code const&);
+ nothing process(quickbook::actions&, code const&);
 }
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: branches/quickbook-1.5-spirit2/code_snippet_types.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/code_snippet_types.hpp (original)
+++ branches/quickbook-1.5-spirit2/code_snippet_types.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -20,8 +20,6 @@
 
 namespace quickbook
 {
- using boost::spirit::unused_type;
-
     struct code_snippet
     {
         file_position position;

Modified: branches/quickbook-1.5-spirit2/fwd.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/fwd.hpp (original)
+++ branches/quickbook-1.5-spirit2/fwd.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -14,6 +14,8 @@
 
 namespace quickbook
 {
+ struct nothing {};
+
     struct macro;
     struct doc_info;
 

Modified: branches/quickbook-1.5-spirit2/parse_types.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/parse_types.hpp (original)
+++ branches/quickbook-1.5-spirit2/parse_types.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -31,7 +31,7 @@
         std::string content;
     };
 
- void process(quickbook::actions&, formatted const&);
+ nothing process(quickbook::actions&, formatted const&);
 }
 
 BOOST_FUSION_ADAPT_STRUCT(

Modified: branches/quickbook-1.5-spirit2/phrase.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase.hpp (original)
+++ branches/quickbook-1.5-spirit2/phrase.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -63,16 +63,6 @@
         std::string image_filename;
         attribute_map attributes;
     };
-
- void process(quickbook::actions&, source_mode const&);
- void process(quickbook::actions&, macro const&);
- void process(quickbook::actions&, call_template const&);
- void process(quickbook::actions&, anchor const&);
- void process(quickbook::actions&, link const&);
- void process(quickbook::actions&, simple_markup const&);
- void process(quickbook::actions&, cond_phrase const&);
- void process(quickbook::actions&, break_ const&);
- void process(quickbook::actions&, image const&);
 }
 
 #endif // BOOST_SPIRIT_QUICKBOOK_PHRASE_HPP

Modified: branches/quickbook-1.5-spirit2/phrase_actions.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase_actions.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase_actions.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -17,11 +17,12 @@
 
 namespace quickbook
 {
- void process(quickbook::actions& actions, source_mode const& s) {
+ nothing process(quickbook::actions& actions, source_mode const& s) {
         actions.source_mode = s.mode;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, macro const& x) {
+ nothing process(quickbook::actions& actions, macro const& x) {
         if (x.raw_markup == quickbook_get_date)
         {
             char strdate[64];
@@ -38,15 +39,17 @@
         {
             actions.phrase << x.raw_markup;
         }
+ return nothing();
     }
 
- void process(quickbook::actions& actions, anchor const& x) {
+ nothing process(quickbook::actions& actions, anchor const& x) {
         actions.phrase << "<anchor id=\"";
         detail::print_string(x.id, actions.phrase.get());
         actions.phrase << "\" />\n";
+ return nothing();
     }
 
- void process(quickbook::actions& actions, link const& x) {
+ nothing process(quickbook::actions& actions, link const& x) {
         actions.phrase << x.type.pre;
         detail::print_string(x.destination, actions.phrase.get());
         actions.phrase << "\">";
@@ -55,13 +58,15 @@
         else
             actions.phrase << x.content;
         actions.phrase << x.type.post;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, formatted const& x) {
+ nothing process(quickbook::actions& actions, formatted const& x) {
         actions.phrase << x.type.pre << x.content << x.type.post;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, simple_markup const& x) {
+ nothing process(quickbook::actions& actions, simple_markup const& x) {
         markup type;
         switch(x.symbol) {
             case '*': type = markup(bold_pre_, bold_post_); break;
@@ -73,32 +78,34 @@
         actions.phrase << type.pre;
         detail::print_string(x.raw_content, actions.phrase.get());
         actions.phrase << type.post;
+ return nothing();
     }
 
- void process(quickbook::actions& actions, cond_phrase const& x) {
+ nothing process(quickbook::actions& actions, cond_phrase const& x) {
         bool symbol_found = actions.macro.find(x.macro_id.c_str());
 
         if (!x.content.empty() && symbol_found) {
             actions.phrase << x.content; // print the body
         }
+ return nothing();
     }
 
- void process(quickbook::actions& actions, break_ const& x) {
+ nothing process(quickbook::actions& actions, break_ const& x) {
         detail::outwarn(x.position.file,x.position.line)
             << "in column:" << x.position.column << ", "
             << "[br] and \\n are deprecated" << ".\n";
         actions.phrase << break_mark;
-
+ return nothing();
     }
 
- void process(quickbook::actions& actions, code const& x) {
+ nothing process(quickbook::actions& actions, code const& x) {
          std::string program = x.code;
     
         if(x.block) {
             // preprocess the code section to remove the initial indentation
             detail::unindent(program);
             if (program.size() == 0)
- return; // Nothing left to do here. The program is empty.
+ return nothing(); // Nothing left to do here. The program is empty.
         }
 
         iterator first_(program.begin(), program.end());
@@ -127,5 +134,6 @@
             actions.phrase << str;
             actions.phrase << "</code>";
         }
+ return nothing();
     }
 }

Modified: branches/quickbook-1.5-spirit2/phrase_image.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase_image.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase_image.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -18,7 +18,7 @@
 {
     namespace fs = boost::filesystem;
 
- void process(quickbook::actions& actions, image const& x)
+ nothing process(quickbook::actions& actions, image const& x)
     {
         std::map<std::string, std::string> attributes(
             x.attributes.begin(), x.attributes.end());
@@ -144,5 +144,7 @@
         actions.phrase << "</phrase></textobject>";
 
         actions.phrase << "</inlinemediaobject>";
+
+ return nothing();
     }
 }
\ No newline at end of file

Added: branches/quickbook-1.5-spirit2/process.cpp
==============================================================================
--- (empty file)
+++ branches/quickbook-1.5-spirit2/process.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -0,0 +1,82 @@
+/*=============================================================================
+ Copyright (c) 2002 2004 2006 Joel de Guzman
+ Copyright (c) 2004 Eric Niebler
+ Copyright (c) 2010 Daniel James
+ http://spirit.sourceforge.net/
+
+ Use, modification and distribution is subject to the Boost Software
+ License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
+=============================================================================*/
+
+#include "fwd.hpp"
+#include "actions.hpp"
+#include "parse_types.hpp"
+#include "phrase.hpp"
+#include "block.hpp"
+#include "code.hpp"
+#include "syntax_highlight.hpp"
+#include "template.hpp"
+
+namespace quickbook
+{
+ template <typename T>
+ void process_action::operator()(T const& x) const
+ {
+ output(actions, process(actions, x));
+ }
+
+ void output(quickbook::actions&, nothing) {}
+
+ nothing process(quickbook::actions&, formatted const&);
+ nothing process(quickbook::actions&, source_mode const&);
+ nothing process(quickbook::actions&, macro const&);
+ nothing process(quickbook::actions&, call_template const&);
+ nothing process(quickbook::actions&, anchor const&);
+ nothing process(quickbook::actions&, link const&);
+ nothing process(quickbook::actions&, simple_markup const&);
+ nothing process(quickbook::actions&, cond_phrase const&);
+ nothing process(quickbook::actions&, break_ const&);
+ nothing process(quickbook::actions&, image const&);
+ nothing process(quickbook::actions&, hr);
+ nothing process(quickbook::actions&, paragraph const&);
+ nothing process(quickbook::actions&, list const&);
+ nothing process(quickbook::actions&, begin_section const&);
+ nothing process(quickbook::actions&, end_section const&);
+ nothing process(quickbook::actions&, heading const&);
+ nothing process(quickbook::actions&, def_macro const&);
+ nothing process(quickbook::actions&, variablelist const&);
+ nothing process(quickbook::actions&, table const&);
+ nothing process(quickbook::actions&, xinclude const&);
+ nothing process(quickbook::actions&, import const&);
+ nothing process(quickbook::actions&, include const&);
+ nothing process(quickbook::actions&, code const&);
+ nothing process(quickbook::actions&, define_template const&);
+ nothing process(quickbook::actions&, code_token const&);
+
+ template void process_action::operator()<formatted>(formatted const&) const;
+ template void process_action::operator()<source_mode>(source_mode const&) const;
+ template void process_action::operator()<macro>(macro const&) const;
+ template void process_action::operator()<call_template>(call_template const&) const;
+ template void process_action::operator()<anchor>(anchor const&) const;
+ template void process_action::operator()<link>(link const&) const;
+ template void process_action::operator()<simple_markup>(simple_markup const&) const;
+ template void process_action::operator()<cond_phrase>(cond_phrase const&) const;
+ template void process_action::operator()<break_>(break_ const&) const;
+ template void process_action::operator()<image>(image const&) const;
+ template void process_action::operator()<hr>(hr const&) const;
+ template void process_action::operator()<paragraph>(paragraph const&) const;
+ template void process_action::operator()<list>(list const&) const;
+ template void process_action::operator()<begin_section>(begin_section const&) const;
+ template void process_action::operator()<end_section>(end_section const&) const;
+ template void process_action::operator()<heading>(heading const&) const;
+ template void process_action::operator()<def_macro>(def_macro const&) const;
+ template void process_action::operator()<variablelist>(variablelist const&) const;
+ template void process_action::operator()<table>(table const&) const;
+ template void process_action::operator()<xinclude>(xinclude const&) const;
+ template void process_action::operator()<import>(import const&) const;
+ template void process_action::operator()<include>(include const&) const;
+ template void process_action::operator()<code>(code const&) const;
+ template void process_action::operator()<define_template>(define_template const&) const;
+ template void process_action::operator()<code_token>(code_token const&) const;
+}
\ No newline at end of file

Modified: branches/quickbook-1.5-spirit2/syntax_highlight.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/syntax_highlight.cpp (original)
+++ branches/quickbook-1.5-spirit2/syntax_highlight.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -19,6 +19,7 @@
 #include "grammars.hpp"
 #include "phrase.hpp"
 #include "utils.hpp"
+#include "syntax_highlight.hpp"
 
 namespace quickbook
 {
@@ -34,7 +35,7 @@
         char const* dummy;
     };
     
- void process(quickbook::actions& actions, code_token const& x)
+ nothing process(quickbook::actions& actions, code_token const& x)
     {
         std::string type = x.type;
         if(type == "space") {
@@ -45,6 +46,8 @@
             detail::print_string(x.text, actions.phrase.get());
             actions.phrase << "</phrase>";
         }
+
+ return nothing();
     }
 }
 

Copied: branches/quickbook-1.5-spirit2/syntax_highlight.hpp (from r59552, /branches/quickbook-1.5-spirit2/code.hpp)
==============================================================================
--- /branches/quickbook-1.5-spirit2/code.hpp (original)
+++ branches/quickbook-1.5-spirit2/syntax_highlight.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -1,35 +1,21 @@
 /*=============================================================================
     Copyright (c) 2002 2004 2006 Joel de Guzman
     Copyright (c) 2004 Eric Niebler
+ Copyright (c) 2010 Daniel James
     http://spirit.sourceforge.net/
 
     Use, modification and distribution is subject to the Boost Software
     License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
     http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
-#if !defined(BOOST_SPIRIT_QUICKBOOK_CODE_HPP)
-#define BOOST_SPIRIT_QUICKBOOK_CODE_HPP
 
-#include <string>
-#include <boost/fusion/include/adapt_struct.hpp>
-#include "fwd.hpp"
+#if !defined(BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP)
+#define BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
 
 namespace quickbook
 {
- struct code {
- bool block;
- file_position position;
- std::string code;
- };
-
- void process(quickbook::actions&, code const&);
+ struct code_token;
+ struct space;
 }
 
-BOOST_FUSION_ADAPT_STRUCT(
- quickbook::code,
- (quickbook::file_position, position)
- (std::string, code)
- (bool, block)
-)
-
 #endif
\ No newline at end of file

Modified: branches/quickbook-1.5-spirit2/template.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/template.cpp (original)
+++ branches/quickbook-1.5-spirit2/template.cpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -342,7 +342,7 @@
         }
     }
 
- void process(quickbook::actions& actions, call_template const& x)
+ nothing process(quickbook::actions& actions, call_template const& x)
     {
         ++actions.template_depth;
         if (actions.template_depth > actions.max_template_depth)
@@ -351,7 +351,7 @@
                 << "Infinite loop detected" << std::endl;
             --actions.template_depth;
             ++actions.error_count;
- return;
+ return nothing();
         }
 
         // The template arguments should have the scope that the template was
@@ -380,7 +380,7 @@
                 actions.pop(); // restore the actions' states
                 --actions.template_depth;
                 ++actions.error_count;
- return;
+ return nothing();
             }
 
             ///////////////////////////////////
@@ -395,7 +395,7 @@
             {
                 actions.pop(); // restore the actions' states
                 --actions.template_depth;
- return;
+ return nothing();
             }
 
             ///////////////////////////////////
@@ -413,13 +413,15 @@
                 actions.pop(); // restore the actions' states
                 --actions.template_depth;
                 ++actions.error_count;
- return;
+ return nothing();
             }
         }
 
         actions.pop(); // restore the actions' states
         actions.phrase << result; // print it!!!
         --actions.template_depth;
+
+ return nothing();
     }
 }
 

Modified: branches/quickbook-1.5-spirit2/template.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/template.hpp (original)
+++ branches/quickbook-1.5-spirit2/template.hpp 2010-02-07 04:08:12 EST (Sun, 07 Feb 2010)
@@ -39,7 +39,7 @@
         quickbook::file_position position;
     };
 
- void process(quickbook::actions&, define_template const&);
+ nothing process(quickbook::actions&, define_template const&);
 
     struct template_scope;
     struct template_symbol;


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