Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59559 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-02-07 04:10:31


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

Log:
Remove some of the stuff in utils.?pp
Text files modified:
   branches/quickbook-1.5-spirit2/actions.cpp | 10 ----------
   branches/quickbook-1.5-spirit2/actions.hpp | 2 --
   branches/quickbook-1.5-spirit2/actions_class.cpp | 1 -
   branches/quickbook-1.5-spirit2/actions_class.hpp | 2 +-
   branches/quickbook-1.5-spirit2/block.cpp | 6 +++---
   branches/quickbook-1.5-spirit2/block_actions.cpp | 2 +-
   branches/quickbook-1.5-spirit2/block_list.cpp | 1 +
   branches/quickbook-1.5-spirit2/boostbook.cpp | 7 ++++++-
   branches/quickbook-1.5-spirit2/boostbook.hpp | 3 +++
   branches/quickbook-1.5-spirit2/doc_info.cpp | 2 +-
   branches/quickbook-1.5-spirit2/phrase.cpp | 4 ++--
   branches/quickbook-1.5-spirit2/process.cpp | 1 +
   branches/quickbook-1.5-spirit2/syntax_highlight.cpp | 4 ++--
   branches/quickbook-1.5-spirit2/utils.cpp | 28 ----------------------------
   branches/quickbook-1.5-spirit2/utils.hpp | 21 ---------------------
   15 files changed, 21 insertions(+), 73 deletions(-)

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:10:29 EST (Sun, 07 Feb 2010)
@@ -45,16 +45,6 @@
         ++error_count;
     }
 
- void plain_char_action::operator()(char ch, unused_type, unused_type) const
- {
- detail::print_char(ch, phrase.get());
- }
-
- void plain_char_action::operator()(iterator_range x, unused_type, unused_type) const
- {
- detail::print_char(*x.begin(), phrase.get());
- }
-
     void element_id_warning_action::operator()(iterator_range x, unused_type, unused_type) const
     {
         file_position const pos = x.begin().get_position();

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:10:29 EST (Sun, 07 Feb 2010)
@@ -14,8 +14,6 @@
 #include <map>
 #include <string>
 #include <vector>
-#include <stack>
-#include <algorithm>
 #include <boost/spirit/include/qi_symbols.hpp>
 #include "fwd.hpp"
 

Modified: branches/quickbook-1.5-spirit2/actions_class.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions_class.cpp (original)
+++ branches/quickbook-1.5-spirit2/actions_class.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -49,7 +49,6 @@
         , error(error_count)
 
         , syntax_p(source_mode, *this)
- , plain_char(phrase)
     {
         // turn off __FILENAME__ macro on debug mode = true
         std::string filename_str = debug_mode ?

Modified: branches/quickbook-1.5-spirit2/actions_class.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/actions_class.hpp (original)
+++ branches/quickbook-1.5-spirit2/actions_class.hpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -10,6 +10,7 @@
 #if !defined(BOOST_SPIRIT_ACTIONS_CLASS_HPP)
 #define BOOST_SPIRIT_ACTIONS_CLASS_HPP
 
+#include <stack>
 #include <boost/tuple/tuple.hpp>
 #include <boost/filesystem/path.hpp>
 #include "fwd.hpp"
@@ -79,7 +80,6 @@
         error_action error;
 
         syntax_highlight syntax_p;
- plain_char_action plain_char;
 
         element_id_warning_action element_id_warning;
     };

Modified: branches/quickbook-1.5-spirit2/block.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/block.cpp (original)
+++ branches/quickbook-1.5-spirit2/block.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -440,7 +440,7 @@
                     ( qi::eol >> *qi::blank >> &(qi::char_('*') | '#')
                     | (eol >> eol)
                     )
- ) [actions.plain_char]
+ ) [actions.process]
             )
>> +eol
>> qi::eps[actions.phrase_pop]
@@ -461,7 +461,7 @@
>> *( common
                 | (qi::char_ - // Make sure we don't go past
                         paragraph_end // a single block.
- ) [actions.plain_char]
+ ) [actions.process]
                 )
>> qi::eps [actions.phrase_pop]
>> (&qi::lit('[') | +eol)
@@ -506,7 +506,7 @@
                 qi::eps [actions.phrase_push]
>> *( common
                 | comment
- | (qi::char_ - phrase_end) [actions.plain_char]
+ | (qi::char_ - phrase_end) [actions.process]
                 )
>> qi::eps [actions.phrase_pop]
             ;

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:10:29 EST (Sun, 07 Feb 2010)
@@ -296,7 +296,7 @@
     xinclude2 process(quickbook::actions& actions, xinclude const& x)
     {
         xinclude2 r;
- r.path = calculate_relative_path(x.path, actions).string();
+ r.path = calculate_relative_path(detail::escape_uri(x.path), actions).string();
         return r;
     }
 

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:10:29 EST (Sun, 07 Feb 2010)
@@ -8,6 +8,7 @@
     http://www.boost.org/LICENSE_1_0.txt)
 =============================================================================*/
 
+#include <stack>
 #include <boost/assert.hpp>
 #include "actions_class.hpp"
 #include "gen_types.hpp"

Modified: branches/quickbook-1.5-spirit2/boostbook.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/boostbook.cpp (original)
+++ branches/quickbook-1.5-spirit2/boostbook.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -123,6 +123,11 @@
         actions.phrase << x;
     }
 
+ void output(quickbook::actions& actions, char x)
+ {
+ actions.phrase << encode(x);
+ }
+
     void output(quickbook::actions& actions, anchor const& x) {
         actions.phrase << "<anchor id=\"";
         actions.phrase << encode(x.id);
@@ -308,7 +313,7 @@
 
     void output(quickbook::actions& actions, xinclude2 const& x)
     {
- actions.phrase << "\n<xi:include href=\"" <<x.path << "\" />\n";
+ actions.phrase << "\n<xi:include href=\"" << x.path << "\" />\n";
     }
 
     void output(quickbook::actions& actions, list2 const& x)

Modified: branches/quickbook-1.5-spirit2/boostbook.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/boostbook.hpp (original)
+++ branches/quickbook-1.5-spirit2/boostbook.hpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -28,6 +28,9 @@
     // should either take a stream/collector to write to, or return their
     // output by value.
 
+ // Note: char is a plain quickbook character, string is an encoded
+ // boostbook string. Oops.
+ void output(quickbook::actions&, char);
     void output(quickbook::actions&, std::string const&);
     void output(quickbook::actions&, anchor const&);
     void output(quickbook::actions&, link const&);

Modified: branches/quickbook-1.5-spirit2/doc_info.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/doc_info.cpp (original)
+++ branches/quickbook-1.5-spirit2/doc_info.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -197,7 +197,7 @@
                 qi::eps [actions.phrase_push]
>> *( common
                 | comment
- | (qi::char_ - ']') [actions.plain_char]
+ | (qi::char_ - ']') [actions.process]
                 )
>> qi::eps [actions.phrase_pop]
             ;

Modified: branches/quickbook-1.5-spirit2/phrase.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/phrase.cpp (original)
+++ branches/quickbook-1.5-spirit2/phrase.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -138,7 +138,7 @@
                 qi::eps [actions.phrase_push]
>> *( common
                 | comment
- | (qi::char_ - phrase_end) [actions.plain_char]
+ | (qi::char_ - phrase_end) [actions.process]
                 )
>> qi::eps [actions.phrase_pop]
             ;
@@ -476,7 +476,7 @@
         phrase =
            *( common
             | comment
- | (qi::char_ - ']') [actions.plain_char]
+ | (qi::char_ - ']') [actions.process]
             )
             ;
 

Modified: branches/quickbook-1.5-spirit2/process.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/process.cpp (original)
+++ branches/quickbook-1.5-spirit2/process.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -63,4 +63,5 @@
     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;
+ template void process_action::operator()<char>(char 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:10:29 EST (Sun, 07 Feb 2010)
@@ -41,7 +41,7 @@
             iterator first = escaped.begin(), last = escaped.end();
             while(first != last) {
                 if(!qi::parse(first, last, common)) {
- actions.plain_char(*first, 0, 0);
+ actions.process(*first);
                     ++first;
                 }
             }
@@ -340,7 +340,7 @@
                 =
                 *( macro [actions.process]
                 | escape
- | qi::char_ [actions.plain_char]
+ | qi::char_ [actions.process]
                 )
                 ;
 

Modified: branches/quickbook-1.5-spirit2/utils.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/utils.cpp (original)
+++ branches/quickbook-1.5-spirit2/utils.cpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -23,34 +23,6 @@
 
 namespace quickbook { namespace detail
 {
- void print_char(char ch, std::ostream& out)
- {
- switch (ch)
- {
- case '<': out << "&lt;"; break;
- case '>': out << "&gt;"; break;
- case '&': out << "&amp;"; break;
- case '"': out << "&quot;"; break;
- default: out << ch; break;
- // note &apos; is not included. see the curse of apos:
- // http://fishbowl.pastiche.org/2003/07/01/the_curse_of_apos
- }
- }
-
- void print_string(std::basic_string<char> const& str, std::ostream& out)
- {
- for (std::string::const_iterator cur = str.begin();
- cur != str.end(); ++cur)
- {
- print_char(*cur, out);
- }
- }
-
- void print_space(char ch, std::ostream& out)
- {
- out << ch;
- }
-
     char filter_identifier_char(char ch)
     {
         if (!std::isalnum(static_cast<unsigned char>(ch)))

Modified: branches/quickbook-1.5-spirit2/utils.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/utils.hpp (original)
+++ branches/quickbook-1.5-spirit2/utils.hpp 2010-02-07 04:10:29 EST (Sun, 07 Feb 2010)
@@ -17,9 +17,6 @@
 
 namespace quickbook { namespace detail
 {
- void print_char(char ch, std::ostream& out);
- void print_string(std::basic_string<char> const& str, std::ostream& out);
- void print_space(char ch, std::ostream& out);
     char filter_identifier_char(char ch);
 
     template <typename Iterator>
@@ -32,24 +29,6 @@
         return out_name;
     }
 
- template <typename T>
- struct var_wrapper
- : public ::boost::reference_wrapper<T>
- {
- typedef ::boost::reference_wrapper<T> parent;
-
- explicit inline var_wrapper(T& t) : parent(t) {}
-
- inline T& operator()() const { return parent::get(); }
- };
-
- template <typename T>
- inline var_wrapper<T>
- var(T& t)
- {
- return var_wrapper<T>(t);
- }
-
     // un-indent a code segment
     void unindent(std::string& program);
 


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