Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r59566 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-02-07 04:12:49


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

Log:
Make syntax_highlight a function.
Text files modified:
   branches/quickbook-1.5-spirit2/actions.cpp | 1 -
   branches/quickbook-1.5-spirit2/actions.hpp | 17 -----------------
   branches/quickbook-1.5-spirit2/code.hpp | 5 +++++
   branches/quickbook-1.5-spirit2/phrase_actions.cpp | 3 ++-
   branches/quickbook-1.5-spirit2/syntax_highlight.cpp | 5 ++++-
   5 files changed, 11 insertions(+), 20 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:12:47 EST (Sun, 07 Feb 2010)
@@ -30,7 +30,6 @@
         , phrase_push(state.phrase)
         , phrase_pop(state.phrase)
         , error(state.error_count)
- , syntax_p(state.source_mode, *this)
     {}
 
     namespace {

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:12:47 EST (Sun, 07 Feb 2010)
@@ -85,22 +85,6 @@
     extern char const* quickbook_get_date;
     extern char const* quickbook_get_time;
 
- struct syntax_highlight
- {
- syntax_highlight(
- std::string const& source_mode
- , actions& escape_actions)
- : source_mode(source_mode)
- , escape_actions(escape_actions)
- {
- }
-
- std::string operator()(iterator begin, iterator end) const;
-
- std::string const& source_mode;
- actions& escape_actions;
- };
-
     struct element_id_warning_action
     {
         void operator()(iterator_range, unused_type, unused_type) const;
@@ -187,7 +171,6 @@
         phrase_pop_action phrase_pop;
         error_action error;
         element_id_warning_action element_id_warning;
- syntax_highlight syntax_p;
     };
 }
 

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:12:47 EST (Sun, 07 Feb 2010)
@@ -21,6 +21,11 @@
         file_position position;
         std::string code;
     };
+
+ std::string syntax_highlight(
+ iterator first, iterator last,
+ actions& escape_actions,
+ std::string& source_mode);
 }
 
 BOOST_FUSION_ADAPT_STRUCT(

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:12:47 EST (Sun, 07 Feb 2010)
@@ -102,7 +102,8 @@
 
         // print the code with syntax coloring
         quickbook::actions actions(state);
- std::string str = actions.syntax_p(first_, last_);
+ std::string str = syntax_highlight(
+ first_, last_, actions, state.source_mode);
 
         state.phrase.swap(save);
         

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:12:47 EST (Sun, 07 Feb 2010)
@@ -368,7 +368,10 @@
         std::string save;
     };
 
- std::string syntax_highlight::operator()(iterator first, iterator last) const
+ std::string syntax_highlight(
+ iterator first, iterator last,
+ actions& escape_actions,
+ std::string& source_mode)
     {
         escape_actions.phrase_push();
 


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