|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r59319 - branches/quickbook-1.5-spirit2
From: daniel_james_at_[hidden]
Date: 2010-01-27 17:06:15
Author: danieljames
Date: 2010-01-27 17:06:14 EST (Wed, 27 Jan 2010)
New Revision: 59319
URL: http://svn.boost.org/trac/boost/changeset/59319
Log:
Combine the syntax_highlight files.
Removed:
branches/quickbook-1.5-spirit2/syntax_highlight.cpp
Text files modified:
branches/quickbook-1.5-spirit2/syntax_highlight.hpp | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
Deleted: branches/quickbook-1.5-spirit2/syntax_highlight.cpp
==============================================================================
--- branches/quickbook-1.5-spirit2/syntax_highlight.cpp 2010-01-27 17:06:14 EST (Wed, 27 Jan 2010)
+++ (empty file)
@@ -1,37 +0,0 @@
-#include "syntax_highlight.hpp"
-#include "actions_class.hpp"
-
-namespace quickbook
-{
- std::string syntax_highlight::operator()(iterator first, iterator last) const
- {
- escape_actions.phrase.push();
-
- // print the code with syntax coloring
- if (source_mode == "c++")
- {
- cpp_highlight cpp_p(escape_actions);
- parse(first, last, cpp_p);
- }
- else if (source_mode == "python")
- {
- python_highlight python_p(escape_actions);
- parse(first, last, python_p);
- }
- else if (source_mode == "teletype")
- {
- teletype_highlight teletype_p(escape_actions);
- parse(first, last, teletype_p);
- }
- else
- {
- BOOST_ASSERT(0);
- }
-
- std::string str;
- escape_actions.phrase.swap(str);
- escape_actions.phrase.pop();
-
- return str;
- }
-}
\ No newline at end of file
Modified: branches/quickbook-1.5-spirit2/syntax_highlight.hpp
==============================================================================
--- branches/quickbook-1.5-spirit2/syntax_highlight.hpp (original)
+++ branches/quickbook-1.5-spirit2/syntax_highlight.hpp 2010-01-27 17:06:14 EST (Wed, 27 Jan 2010)
@@ -15,6 +15,7 @@
#include <boost/spirit/include/qi_string.hpp>
#include <boost/spirit/include/qi_directive.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
+#include "actions_class.hpp"
#include "parse_types.hpp"
#include "grammars.hpp"
#include "phrase.hpp"
@@ -396,6 +397,37 @@
std::string save;
};
+ std::string syntax_highlight::operator()(iterator first, iterator last) const
+ {
+ escape_actions.phrase.push();
+
+ // print the code with syntax coloring
+ if (source_mode == "c++")
+ {
+ cpp_highlight cpp_p(escape_actions);
+ parse(first, last, cpp_p);
+ }
+ else if (source_mode == "python")
+ {
+ python_highlight python_p(escape_actions);
+ parse(first, last, python_p);
+ }
+ else if (source_mode == "teletype")
+ {
+ teletype_highlight teletype_p(escape_actions);
+ parse(first, last, teletype_p);
+ }
+ else
+ {
+ BOOST_ASSERT(0);
+ }
+
+ std::string str;
+ escape_actions.phrase.swap(str);
+ escape_actions.phrase.pop();
+
+ return str;
+ }
}
#endif // BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
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