|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51281 - in branches/release: . tools/boostbook/dtd/1.1 tools/boostbook/xsl tools/boostbook/xsl/doxygen tools/quickbook tools/quickbook/detail tools/quickbook/test tools/quickbook/test/src
From: daniel_james_at_[hidden]
Date: 2009-02-16 19:01:05
Author: danieljames
Date: 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
New Revision: 51281
URL: http://svn.boost.org/trac/boost/changeset/51281
Log:
Merge several changes to boostbook and quickbook.
Fixes #1399
Merged revisions 49231,49459,49988,50068,50084,50091,50109,50125,50142,50159,50163,50175,50193,50207,50210-50213,50215,50222,50246,50513 via svnmerge from
https://svn.boost.org/svn/boost/trunk
........
r49231 | danieljames | 2008-10-09 23:14:14 +0100 (Thu, 09 Oct 2008) | 4 lines
Work around the problems with window newlines in position_iterator. (I'm
about to fix them, but this will get quickbook working immediately).
........
r49459 | eric_niebler | 2008-10-26 20:24:59 +0000 (Sun, 26 Oct 2008) | 1 line
give data members with <purpose> in synopses the same treatment as functions and typedefs
........
r49988 | danieljames | 2008-11-28 15:05:21 +0000 (Fri, 28 Nov 2008) | 1 line
When processing template arguments, deal with the case when there's no content after the last space or there are more arguments than expected.
........
r50068 | johnmaddock | 2008-12-02 13:13:57 +0000 (Tue, 02 Dec 2008) | 1 line
Fix Jamfile by adding <preserve-test-targets>on to test requirements.
........
r50084 | johnmaddock | 2008-12-03 09:42:52 +0000 (Wed, 03 Dec 2008) | 1 line
Added quickbook-fail-test rule and two tests that make use of it: note that these currently fail.
........
r50091 | danieljames | 2008-12-03 19:14:42 +0000 (Wed, 03 Dec 2008) | 2 lines
Keep a count of errors in quickbook, and return an error code when appropriate.
........
r50109 | johnmaddock | 2008-12-04 10:14:19 +0000 (Thu, 04 Dec 2008) | 1 line
Added dependency to the test file.
........
r50125 | djowel | 2008-12-05 02:13:59 +0000 (Fri, 05 Dec 2008) | 1 line
updated to use "classic" spirit includes and namespace
........
r50142 | danieljames | 2008-12-05 19:03:19 +0000 (Fri, 05 Dec 2008) | 1 line
Defined BOOST_CYGWIN_PATH when building quickbook on cygwin.
........
r50159 | danieljames | 2008-12-06 14:07:35 +0000 (Sat, 06 Dec 2008) | 1 line
Copy boostbook.dtd into the correct position for the 1.1 uri. I'm not sure what should be done with the existing location.
........
r50163 | danieljames | 2008-12-06 19:22:32 +0000 (Sat, 06 Dec 2008) | 1 line
Revert my change to the quickbook jamfile, it isn't adequately tested.
........
r50175 | danieljames | 2008-12-07 12:37:07 +0000 (Sun, 07 Dec 2008) | 1 line
Fix processing of unmatched escape characters in code - and issue a warning for unexpected characters.
........
r50193 | danieljames | 2008-12-08 16:17:13 +0000 (Mon, 08 Dec 2008) | 1 line
Use new include paths for classic spirit in quickbook text_diff utility.
........
r50207 | danieljames | 2008-12-08 21:51:56 +0000 (Mon, 08 Dec 2008) | 1 line
Fail on a mismatched '' in the python and c++ syntax highlighters. And then ignore the rest of the code block to avoid further errors and warnings.
........
r50210 | danieljames | 2008-12-08 23:14:23 +0000 (Mon, 08 Dec 2008) | 1 line
Hard fail on quickbook post process errors.
........
r50211 | danieljames | 2008-12-08 23:20:26 +0000 (Mon, 08 Dec 2008) | 1 line
Since I accidently added a quickbook fail tests to the Jamfile in the last checkin, I might as well add them.
........
r50212 | danieljames | 2008-12-08 23:35:08 +0000 (Mon, 08 Dec 2008) | 1 line
Remove an unused variable in order to avoid a gcc warning.
........
r50213 | danieljames | 2008-12-08 23:35:20 +0000 (Mon, 08 Dec 2008) | 1 line
Run the docbook chunker quietly, unless boostbook.verbose is set.
........
r50215 | danieljames | 2008-12-08 23:38:29 +0000 (Mon, 08 Dec 2008) | 1 line
Put the markup strings in their own cpp file to avoid gcc warnings.
........
r50222 | danieljames | 2008-12-09 13:52:07 +0000 (Tue, 09 Dec 2008) | 1 line
Fix some xsl type errors.
........
r50246 | speedsnail | 2008-12-12 15:06:44 +0000 (Fri, 12 Dec 2008) | 1 line
Make doxygen command "\throw" work with boostbook.
........
r50513 | danieljames | 2009-01-08 12:01:50 +0000 (Thu, 08 Jan 2009) | 1 line
Support both windows and cygwin paths in cygwin quickbook.
........
Added:
branches/release/tools/boostbook/dtd/1.1/
- copied from r50159, /trunk/tools/boostbook/dtd/1.1/
branches/release/tools/boostbook/dtd/1.1/boostbook.dtd
- copied unchanged from r50159, /trunk/tools/boostbook/dtd/1.1/boostbook.dtd
branches/release/tools/quickbook/detail/input_path.cpp
- copied unchanged from r50513, /trunk/tools/quickbook/detail/input_path.cpp
branches/release/tools/quickbook/detail/input_path.hpp
- copied unchanged from r50513, /trunk/tools/quickbook/detail/input_path.hpp
branches/release/tools/quickbook/detail/markups.cpp
- copied unchanged from r50215, /trunk/tools/quickbook/detail/markups.cpp
branches/release/tools/quickbook/test/fail-cpp-mismatched-escape.quickbook
- copied unchanged from r50213, /trunk/tools/quickbook/test/fail-cpp-mismatched-escape.quickbook
branches/release/tools/quickbook/test/fail-import.quickbook
- copied unchanged from r50084, /trunk/tools/quickbook/test/fail-import.quickbook
branches/release/tools/quickbook/test/fail-include.quickbook
- copied unchanged from r50084, /trunk/tools/quickbook/test/fail-include.quickbook
branches/release/tools/quickbook/test/fail-parse-error1.quickbook
- copied unchanged from r50213, /trunk/tools/quickbook/test/fail-parse-error1.quickbook
branches/release/tools/quickbook/test/fail-parse-error2.quickbook
- copied unchanged from r50213, /trunk/tools/quickbook/test/fail-parse-error2.quickbook
branches/release/tools/quickbook/test/fail-post-process.quickbook
- copied unchanged from r50213, /trunk/tools/quickbook/test/fail-post-process.quickbook
branches/release/tools/quickbook/test/fail-python-mismatched-escape.quickbook
- copied unchanged from r50213, /trunk/tools/quickbook/test/fail-python-mismatched-escape.quickbook
branches/release/tools/quickbook/test/fail-template-arguments1.quickbook
- copied unchanged from r50091, /trunk/tools/quickbook/test/fail-template-arguments1.quickbook
branches/release/tools/quickbook/test/fail-template-arguments2.quickbook
- copied unchanged from r50091, /trunk/tools/quickbook/test/fail-template-arguments2.quickbook
Properties modified:
branches/release/ (props changed)
Text files modified:
branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 4
branches/release/tools/boostbook/xsl/html.xsl | 2
branches/release/tools/boostbook/xsl/type.xsl | 56 ++++++++----
branches/release/tools/boostbook/xsl/xhtml.xsl | 2
branches/release/tools/quickbook/Jamfile.v2 | 2
branches/release/tools/quickbook/block.hpp | 14 +-
branches/release/tools/quickbook/code_snippet.hpp | 4
branches/release/tools/quickbook/detail/actions.cpp | 67 ++++++++++-----
branches/release/tools/quickbook/detail/actions.hpp | 24 ++++-
branches/release/tools/quickbook/detail/actions_class.cpp | 7
branches/release/tools/quickbook/detail/actions_class.hpp | 3
branches/release/tools/quickbook/detail/markups.hpp | 176 ++++++++++++++++++++--------------------
branches/release/tools/quickbook/detail/post_process.cpp | 9 +
branches/release/tools/quickbook/detail/post_process.hpp | 2
branches/release/tools/quickbook/detail/quickbook.cpp | 34 +++++--
branches/release/tools/quickbook/detail/template_stack.cpp | 6
branches/release/tools/quickbook/detail/template_stack.hpp | 26 ++--
branches/release/tools/quickbook/detail/utils.cpp | 23 ++++
branches/release/tools/quickbook/doc_info.hpp | 10 +-
branches/release/tools/quickbook/phrase.hpp | 12 +-
branches/release/tools/quickbook/syntax_highlight.hpp | 61 +++++++++----
branches/release/tools/quickbook/test/Jamfile.v2 | 14 ++
branches/release/tools/quickbook/test/quickbook-testing.jam | 25 +++++
branches/release/tools/quickbook/test/src/text_diff.cpp | 6
24 files changed, 369 insertions(+), 220 deletions(-)
Modified: branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl (original)
+++ branches/release/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -1208,12 +1208,12 @@
<xsl:if test="@kind='exception'">
<simpara>
<xsl:choose>
- <xsl:when test="normalize-space(.//parametername/text())='nothrow'">
+ <xsl:when test="normalize-space(.//parametername//text())='nothrow'">
<xsl:text>Will not throw.</xsl:text>
</xsl:when>
<xsl:otherwise>
<classname>
- <xsl:value-of select=".//parametername/text()"/>
+ <xsl:value-of select=".//parametername//text()"/>
</classname>
<xsl:text> </xsl:text>
<xsl:apply-templates
Modified: branches/release/tools/boostbook/xsl/html.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/html.xsl (original)
+++ branches/release/tools/boostbook/xsl/html.xsl 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -26,6 +26,7 @@
<xsl:param name="admon.style"/>
<xsl:param name="admon.graphics">1</xsl:param>
+ <xsl:param name="boostbook.verbose" select="0"/>
<xsl:param name="html.stylesheet" select="'boostbook.css'"/>
<xsl:param name="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
@@ -38,6 +39,7 @@
<xsl:param name="generate.section.toc.level" select="3"/>
<xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
+ <xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name = "admon.graphics.path"
Modified: branches/release/tools/boostbook/xsl/type.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/type.xsl (original)
+++ branches/release/tools/boostbook/xsl/type.xsl 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -1135,29 +1135,29 @@
ancestor::struct|ancestor::struct-specialization|
ancestor::union|ancestor::union-specialization">
- <!-- Spacing -->
- <xsl:if
- test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() > 1)">
- <xsl:text> </xsl:text>
- </xsl:if>
+ <!-- Spacing -->
+ <xsl:if
+ test="not(local-name(preceding-sibling::*[position()=1])=local-name(.)) and (position() > 1)">
+ <xsl:text> </xsl:text>
+ </xsl:if>
- <!-- Indent -->
- <xsl:text> </xsl:text>
- <xsl:call-template name="indent">
- <xsl:with-param name="indentation" select="$indentation"/>
- </xsl:call-template>
+ <!-- Indent -->
+ <xsl:text> </xsl:text>
+ <xsl:call-template name="indent">
+ <xsl:with-param name="indentation" select="$indentation"/>
+ </xsl:call-template>
- <xsl:if test="@specifiers">
- <xsl:call-template name="highlight-keyword">
- <xsl:with-param name="keyword" select="@specifiers"/>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- </xsl:if>
+ <xsl:if test="@specifiers">
+ <xsl:call-template name="highlight-keyword">
+ <xsl:with-param name="keyword" select="@specifiers"/>
+ </xsl:call-template>
+ <xsl:text> </xsl:text>
+ </xsl:if>
- <xsl:apply-templates select="type" mode="highlight"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="@name"/>
- <xsl:text>;</xsl:text>
+ <xsl:apply-templates select="type" mode="highlight"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>;</xsl:text>
</xsl:when>
<xsl:otherwise>
@@ -1166,6 +1166,22 @@
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
+
+ <!-- If there is a <purpose>, then add it as an
+ inline comment immediately following the data
+ member definition in the synopsis -->
+ <xsl:if test="purpose">
+ <xsl:call-template name="indent">
+ <xsl:with-param name="indentation" select="$indentation"/>
+ </xsl:call-template>
+ <xsl:call-template name="highlight-comment">
+ <xsl:with-param name="text">
+ <xsl:text>// </xsl:text>
+ <xsl:apply-templates select="purpose/*|purpose/text()"
+ mode="purpose"/>
+ </xsl:with-param>
+ </xsl:call-template>
+ </xsl:if>
</xsl:template>
<!-- Data member reference -->
Modified: branches/release/tools/boostbook/xsl/xhtml.xsl
==============================================================================
--- branches/release/tools/boostbook/xsl/xhtml.xsl (original)
+++ branches/release/tools/boostbook/xsl/xhtml.xsl 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -26,6 +26,7 @@
<xsl:param name="admon.style"/>
<xsl:param name="admon.graphics">1</xsl:param>
+ <xsl:param name="boostbook.verbose" select="0"/>
<xsl:param name="html.stylesheet" select="'boostbook.css'"/>
<xsl:param name="navig.graphics" select="1"/>
<xsl:param name="navig.graphics.extension" select="'.png'"/>
@@ -38,6 +39,7 @@
<xsl:param name="generate.section.toc.level" select="3"/>
<xsl:param name="doc.standalone">false</xsl:param>
<xsl:param name="chunker.output.indent">yes</xsl:param>
+ <xsl:param name="chunk.quietly" select="not(number($boostbook.verbose))"/>
<xsl:param name="toc.max.depth">2</xsl:param>
<xsl:param name="callout.graphics.number.limit">15</xsl:param>
<xsl:param name = "admon.graphics.path"
Modified: branches/release/tools/quickbook/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/Jamfile.v2 (original)
+++ branches/release/tools/quickbook/Jamfile.v2 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -14,9 +14,11 @@
detail/actions.cpp
detail/actions_class.cpp
detail/utils.cpp
+ detail/input_path.cpp
detail/post_process.cpp
detail/collector.cpp
detail/template_stack.cpp
+ detail/markups.cpp
/boost//program_options
/boost//filesystem
: #<define>QUICKBOOK_NO_DATES
Modified: branches/release/tools/quickbook/block.hpp
==============================================================================
--- branches/release/tools/quickbook/block.hpp (original)
+++ branches/release/tools/quickbook/block.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -12,16 +12,16 @@
#include "./detail/utils.hpp"
#include "./phrase.hpp"
-#include <boost/spirit/core.hpp>
-#include <boost/spirit/utility/confix.hpp>
-#include <boost/spirit/utility/chset.hpp>
-#include <boost/spirit/actor/assign_actor.hpp>
-#include <boost/spirit/dynamic/if.hpp>
-#include <boost/spirit/symbols/symbols.hpp>
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_confix.hpp>
+#include <boost/spirit/include/classic_chset.hpp>
+#include <boost/spirit/include/classic_assign_actor.hpp>
+#include <boost/spirit/include/classic_if.hpp>
+#include <boost/spirit/include/classic_symbols.hpp>
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
template <typename Actions, bool skip_initial_spaces = false>
struct block_grammar : grammar<block_grammar<Actions> >
Modified: branches/release/tools/quickbook/code_snippet.hpp
==============================================================================
--- branches/release/tools/quickbook/code_snippet.hpp (original)
+++ branches/release/tools/quickbook/code_snippet.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -9,8 +9,8 @@
#if !defined(BOOST_SPIRIT_QUICKBOOK_CODE_SNIPPET_HPP)
#define BOOST_SPIRIT_QUICKBOOK_CODE_SNIPPET_HPP
-#include <boost/spirit/core.hpp>
-#include <boost/spirit/actor.hpp>
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_actor.hpp>
#include "./detail/template_stack.hpp"
namespace quickbook
Modified: branches/release/tools/quickbook/detail/actions.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.cpp (original)
+++ branches/release/tools/quickbook/detail/actions.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -27,7 +27,7 @@
// Handles line-breaks (DEPRECATED!!!)
void break_action::operator()(iterator first, iterator) const
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outwarn(pos.file,pos.line) << "in column:" << pos.column << ", "
<< "[br] and \\n are deprecated" << ".\n";
phrase << break_mark;
@@ -35,9 +35,10 @@
void error_action::operator()(iterator first, iterator /*last*/) const
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
<< "Syntax Error near column " << pos.column << ".\n";
+ ++error_count;
}
void phrase_action::operator()(iterator first, iterator last) const
@@ -224,11 +225,12 @@
if (mark != list_marks.top().first) // new_indent == list_indent
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
<< "Illegal change of list style near column " << pos.column << ".\n";
detail::outwarn(pos.file,pos.line)
<< "Ignoring change of list style" << std::endl;
+ ++error_count;
}
}
@@ -240,8 +242,15 @@
out << "</phrase>";
}
- void unexpected_char::operator()(char) const
+ void unexpected_char::operator()(iterator first, iterator last) const
{
+ boost::spirit::classic::file_position const pos = first.get_position();
+
+ detail::outwarn(pos.file, pos.line)
+ << "in column:" << pos.column
+ << ", unexpected character: " << std::string(first, last)
+ << "\n";
+
out << '#'; // print out an unexpected character
}
@@ -481,9 +490,10 @@
BOOST_ASSERT(actions.template_info.size());
if (actions.templates.find_top_scope(actions.template_info[0]))
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
<< "Template Redefinition: " << actions.template_info[0] << std::endl;
+ ++actions.error_count;
}
actions.template_info.push_back(std::string(first, last));
@@ -498,12 +508,12 @@
bool break_arguments(
std::vector<std::string>& template_info
, std::vector<std::string> const& template_
- , boost::spirit::file_position const& pos
+ , boost::spirit::classic::file_position const& pos
)
{
if (template_.size()-1 != template_info.size())
{
- while (template_.size()-1 != template_info.size())
+ while (template_.size()-1 > template_info.size())
{
// Try to break the last argument at the first space found
// and push it into the back of template_info. Do this
@@ -516,6 +526,8 @@
break;
std::string first(str.begin(), str.begin()+l_pos);
std::string::size_type r_pos = str.find_first_not_of(" \t\r\n", l_pos);
+ if (r_pos == std::string::npos)
+ break;
std::string second(str.begin()+r_pos, str.end());
str = first;
template_info.push_back(second);
@@ -540,7 +552,7 @@
get_arguments(
std::vector<std::string>& template_info
, std::vector<std::string> const& template_
- , boost::spirit::file_position const& pos
+ , boost::spirit::classic::file_position const& pos
, quickbook::actions& actions
)
{
@@ -555,10 +567,11 @@
tinfo.push_back(*arg);
template_symbol template_(tinfo, pos);
- if (template_symbol* p = actions.templates.find_top_scope(*tpl))
+ if (actions.templates.find_top_scope(*tpl))
{
detail::outerr(pos.file,pos.line)
<< "Duplicate Symbol Found" << std::endl;
+ ++actions.error_count;
return std::make_pair(false, tpl);
}
else
@@ -573,7 +586,7 @@
bool parse_template(
std::string& body
, std::string& result
- , boost::spirit::file_position const& template_pos
+ , boost::spirit::classic::file_position const& template_pos
, quickbook::actions& actions
)
{
@@ -604,7 +617,7 @@
iterator first(body.begin(), body.end(), actions.filename.native_file_string().c_str());
first.set_position(template_pos);
iterator last(body.end(), body.end());
- r = boost::spirit::parse(first, last, phrase_p).full;
+ r = boost::spirit::classic::parse(first, last, phrase_p).full;
actions.phrase.swap(result);
}
else
@@ -619,7 +632,7 @@
iterator first(iter, body.end(), actions.filename.native_file_string().c_str());
first.set_position(template_pos);
iterator last(body.end(), body.end());
- r = boost::spirit::parse(first, last, block_p).full;
+ r = boost::spirit::classic::parse(first, last, block_p).full;
actions.out.swap(result);
}
return r;
@@ -628,13 +641,14 @@
void do_template_action::operator()(iterator first, iterator) const
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
++actions.template_depth;
if (actions.template_depth > actions.max_template_depth)
{
detail::outerr(pos.file,pos.line)
<< "Infinite loop detected" << std::endl;
--actions.template_depth;
+ ++actions.error_count;
return;
}
@@ -646,7 +660,7 @@
BOOST_ASSERT(symbol);
std::vector<std::string> template_ = boost::get<0>(*symbol);
- boost::spirit::file_position template_pos = boost::get<1>(*symbol);
+ boost::spirit::classic::file_position template_pos = boost::get<1>(*symbol);
std::vector<std::string> template_info;
std::swap(template_info, actions.template_info);
@@ -657,6 +671,7 @@
{
actions.pop(); // restore the actions' states
--actions.template_depth;
+ ++actions.error_count;
return;
}
@@ -682,7 +697,7 @@
if (!parse_template(body, result, template_pos, actions))
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
<< "Expanding template:" << template_info[0] << std::endl
<< "------------------begin------------------" << std::endl
@@ -691,6 +706,7 @@
<< std::endl;
actions.pop(); // restore the actions' states
--actions.template_depth;
+ ++actions.error_count;
return;
}
}
@@ -885,9 +901,11 @@
--section_level;
if (section_level < 0)
{
- boost::spirit::file_position const pos = first.get_position();
+ boost::spirit::classic::file_position const pos = first.get_position();
detail::outerr(pos.file,pos.line)
<< "Mismatched [endsect] near column " << pos.column << ".\n";
+ ++error_count;
+
// $$$ TODO: somehow fail parse else BOOST_ASSERT(std::string::npos != n)
// $$$ below will assert.
}
@@ -1040,7 +1058,7 @@
id.clear();
}
- void load_snippets(
+ int load_snippets(
std::string const& file
, std::vector<template_symbol>& storage // snippets are stored in a
// vector of template_symbols
@@ -1050,14 +1068,17 @@
std::string code;
int err = detail::load(file, code);
if (err != 0)
- return; // return early on error
+ return err; // return early on error
typedef position_iterator<std::string::const_iterator> iterator_type;
iterator_type first(code.begin(), code.end(), file);
iterator_type last(code.end(), code.end());
cpp_code_snippet_grammar g(storage, doc_id);
- boost::spirit::parse(first, last, g);
+ // TODO: Should I check that parse succeeded?
+ boost::spirit::classic::parse(first, last, g);
+
+ return 0;
}
namespace
@@ -1096,16 +1117,18 @@
fs::path path = include_search(actions.filename.branch_path(), std::string(first,last));
std::string ext = fs::extension(path);
std::vector<template_symbol> storage;
- load_snippets(path.string(), storage, ext, actions.doc_id);
+ actions.error_count +=
+ load_snippets(path.string(), storage, ext, actions.doc_id);
BOOST_FOREACH(template_symbol const& ts, storage)
{
std::string tname = boost::get<0>(ts)[0];
if (actions.templates.find_top_scope(tname))
{
- boost::spirit::file_position const pos = boost::get<1>(ts);
+ boost::spirit::classic::file_position const pos = boost::get<1>(ts);
detail::outerr(pos.file, pos.line)
<< "Template Redefinition: " << tname << std::endl;
+ ++actions.error_count;
}
else
{
@@ -1142,7 +1165,7 @@
}
// update the __FILENAME__ macro
- *boost::spirit::find(actions.macro, "__FILENAME__") = actions.filename.native_file_string();
+ *boost::spirit::classic::find(actions.macro, "__FILENAME__") = actions.filename.native_file_string();
// parse the file
quickbook::parse(actions.filename.native_file_string().c_str(), actions, true);
Modified: branches/release/tools/quickbook/detail/actions.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions.hpp (original)
+++ branches/release/tools/quickbook/detail/actions.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -16,7 +16,7 @@
#include <vector>
#include <stack>
#include <algorithm>
-#include <boost/spirit/iterator/position_iterator.hpp>
+#include <boost/spirit/include/classic_iterator.hpp>
#include <boost/filesystem/operations.hpp>
#include <boost/foreach.hpp>
#include <boost/tuple/tuple.hpp>
@@ -54,7 +54,13 @@
{
// Prints an error message to std::cerr
+ error_action(
+ int& error_count)
+ : error_count(error_count) {}
+
void operator()(iterator first, iterator /*last*/) const;
+
+ int& error_count;
};
struct phrase_action
@@ -230,16 +236,19 @@
list_format_action(
collector& out
, int& list_indent
- , std::stack<mark_type>& list_marks)
+ , std::stack<mark_type>& list_marks
+ , int& error_count)
: out(out)
, list_indent(list_indent)
- , list_marks(list_marks) {}
+ , list_marks(list_marks)
+ , error_count(error_count) {}
void operator()(iterator first, iterator last) const;
collector& out;
int& list_indent;
std::stack<mark_type>& list_marks;
+ int& error_count;
};
struct span
@@ -262,7 +271,7 @@
unexpected_char(collector& out)
: out(out) {}
- void operator()(char) const;
+ void operator()(iterator first, iterator last) const;
collector& out;
};
@@ -671,16 +680,19 @@
end_section_action(
collector& out
, int& section_level
- , std::string& qualified_section_id)
+ , std::string& qualified_section_id
+ , int& error_count)
: out(out)
, section_level(section_level)
- , qualified_section_id(qualified_section_id) {}
+ , qualified_section_id(qualified_section_id)
+ , error_count(error_count) {}
void operator()(iterator first, iterator last) const;
collector& out;
int& section_level;
std::string& qualified_section_id;
+ int& error_count;
};
struct xinclude_action
Modified: branches/release/tools/quickbook/detail/actions_class.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.cpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -62,9 +62,10 @@
, template_depth(0)
, template_escape(false)
, templates()
+ , error_count(0)
// actions
- , error()
+ , error(error_count)
, extract_doc_license(doc_license, phrase)
, extract_doc_purpose(doc_purpose, phrase)
@@ -96,7 +97,7 @@
, cond_phrase_post(phrase, conditions, macro)
, list(out, list_buffer, list_indent, list_marks)
- , list_format(list_buffer, list_indent, list_marks)
+ , list_format(list_buffer, list_indent, list_marks, error_count)
, list_item(list_buffer, phrase, list_item_pre, list_item_post)
, funcref_pre(phrase, funcref_pre_)
@@ -165,7 +166,7 @@
, anchor(out)
, begin_section(out, phrase, doc_id, section_id, section_level, qualified_section_id)
- , end_section(out, section_level, qualified_section_id)
+ , end_section(out, section_level, qualified_section_id, error_count)
, xinclude(out, *this)
, include(*this)
, import(out, *this)
Modified: branches/release/tools/quickbook/detail/actions_class.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/actions_class.hpp (original)
+++ branches/release/tools/quickbook/detail/actions_class.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -15,7 +15,7 @@
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
namespace fs = boost::filesystem;
struct actions
@@ -90,6 +90,7 @@
int template_depth;
bool template_escape;
template_stack templates;
+ int error_count;
// push/pop the states and the streams
void push();
Modified: branches/release/tools/quickbook/detail/markups.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/markups.hpp (original)
+++ branches/release/tools/quickbook/detail/markups.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -10,95 +10,95 @@
#if !defined(BOOST_SPIRIT_MARKUPS_HPP)
#define BOOST_SPIRIT_MARKUPS_HPP
-namespace quickbook { namespace /*unnamed*/
+namespace quickbook
{
- const char* comment_pre = "<!--";
- const char* comment_post = "-->";
- const char* paragraph_pre = "<para>\n";
- const char* paragraph_post = "</para>\n";
- const char* h1_pre = "<bridgehead renderas=\"sect1\">";
- const char* h1_post = "</bridgehead>";
- const char* h2_pre = "<bridgehead renderas=\"sect2\">";
- const char* h2_post = "</bridgehead>";
- const char* h3_pre = "<bridgehead renderas=\"sect3\">";
- const char* h3_post = "</bridgehead>";
- const char* h4_pre = "<bridgehead renderas=\"sect4\">";
- const char* h4_post = "</bridgehead>";
- const char* h5_pre = "<bridgehead renderas=\"sect5\">";
- const char* h5_post = "</bridgehead>";
- const char* h6_pre = "<bridgehead renderas=\"sect6\">";
- const char* h6_post = "</bridgehead>";
- const char* hr_ = "<para/>";
- const char* blurb_pre = "<sidebar role=\"blurb\">\n";
- const char* blurb_post = "</sidebar>\n";
- const char* blockquote_pre = "<blockquote><para>";
- const char* blockquote_post = "</para></blockquote>";
- const char* preformatted_pre = "<programlisting>";
- const char* preformatted_post = "</programlisting>";
- const char* warning_pre = "<warning>";
- const char* warning_post = "</warning>";
- const char* caution_pre = "<caution>";
- const char* caution_post = "</caution>";
- const char* important_pre = "<important>";
- const char* important_post = "</important>";
- const char* note_pre = "<note>";
- const char* note_post = "</note>";
- const char* tip_pre = "<tip>";
- const char* tip_post = "</tip>";
- const char* list_item_pre = "<listitem>\n";
- const char* list_item_post = "\n</listitem>";
- const char* bold_pre_ = "<emphasis role=\"bold\">";
- const char* bold_post_ = "</emphasis>";
- const char* italic_pre_ = "<emphasis>";
- const char* italic_post_ = "</emphasis>";
- const char* underline_pre_ = "<emphasis role=\"underline\">";
- const char* underline_post_ = "</emphasis>";
- const char* teletype_pre_ = "<literal>";
- const char* teletype_post_ = "</literal>";
- const char* strikethrough_pre_ = "<emphasis role=\"strikethrough\">";
- const char* strikethrough_post_ = "</emphasis>";
- const char* quote_pre_ = "<quote>";
- const char* quote_post_ = "</quote>";
- const char* break_mark = "<sbr/>\n";
- const char* url_pre_ = "<ulink url=\"";
- const char* url_post_ = "</ulink>";
- const char* link_pre_ = "<link linkend=\"";
- const char* link_post_ = "</link>";
- const char* start_varlistentry_ = "<varlistentry>";
- const char* end_varlistentry_ = "</varlistentry>\n";
- const char* start_varlistterm_ = "<term>";
- const char* end_varlistterm_ = "</term>";
- const char* start_varlistitem_ = "<listitem>";
- const char* end_varlistitem_ = "</listitem>";
- const char* start_header_ = "<thead>";
- const char* end_header_ = "</thead>\n";
- const char* start_row_ = "<row>";
- const char* end_row_ = "</row>\n";
- const char* start_cell_ = "<entry>";
- const char* end_cell_ = "</entry>";
- const char* funcref_pre_ = "<functionname alt=\"";
- const char* funcref_post_ = "</functionname>";
- const char* classref_pre_ = "<classname alt=\"";
- const char* classref_post_ = "</classname>";
- const char* memberref_pre_ = "<methodname alt=\"";
- const char* memberref_post_ = "</methodname>";
- const char* enumref_pre_ = "<enumname alt=\"";
- const char* enumref_post_ = "</enumname>";
- const char* macroref_pre_ = "<macroname alt=\"";
- const char* macroref_post_ = "</macroname>";
- const char* headerref_pre_ = "<headername alt=\"";
- const char* headerref_post_ = "</headername>";
- const char* conceptref_pre_ = "<conceptname alt=\"";
- const char* conceptref_post_ = "</conceptname>";
- const char* globalref_pre_ = "<globalname alt=\"";
- const char* globalref_post_ = "</globalname>";
- const char* footnote_pre_ = "<footnote><para>";
- const char* footnote_post_ = "</para></footnote>";
- const char* escape_pre_ = "<!--quickbook-escape-prefix-->";
- const char* escape_post_ = "<!--quickbook-escape-postfix-->";
- const char* replaceable_pre_ = "<replaceable>";
- const char* replaceable_post_ = "</replaceable>";
-}}
+ extern const char* comment_pre;
+ extern const char* comment_post;
+ extern const char* paragraph_pre;
+ extern const char* paragraph_post;
+ extern const char* h1_pre;
+ extern const char* h1_post;
+ extern const char* h2_pre;
+ extern const char* h2_post;
+ extern const char* h3_pre;
+ extern const char* h3_post;
+ extern const char* h4_pre;
+ extern const char* h4_post;
+ extern const char* h5_pre;
+ extern const char* h5_post;
+ extern const char* h6_pre;
+ extern const char* h6_post;
+ extern const char* hr_;
+ extern const char* blurb_pre;
+ extern const char* blurb_post;
+ extern const char* blockquote_pre;
+ extern const char* blockquote_post;
+ extern const char* preformatted_pre;
+ extern const char* preformatted_post;
+ extern const char* warning_pre;
+ extern const char* warning_post;
+ extern const char* caution_pre;
+ extern const char* caution_post;
+ extern const char* important_pre;
+ extern const char* important_post;
+ extern const char* note_pre;
+ extern const char* note_post;
+ extern const char* tip_pre;
+ extern const char* tip_post;
+ extern const char* list_item_pre;
+ extern const char* list_item_post;
+ extern const char* bold_pre_;
+ extern const char* bold_post_;
+ extern const char* italic_pre_;
+ extern const char* italic_post_;
+ extern const char* underline_pre_;
+ extern const char* underline_post_;
+ extern const char* teletype_pre_;
+ extern const char* teletype_post_;
+ extern const char* strikethrough_pre_;
+ extern const char* strikethrough_post_;
+ extern const char* quote_pre_;
+ extern const char* quote_post_;
+ extern const char* break_mark;
+ extern const char* url_pre_;
+ extern const char* url_post_;
+ extern const char* link_pre_;
+ extern const char* link_post_;
+ extern const char* start_varlistentry_;
+ extern const char* end_varlistentry_;
+ extern const char* start_varlistterm_;
+ extern const char* end_varlistterm_;
+ extern const char* start_varlistitem_;
+ extern const char* end_varlistitem_;
+ extern const char* start_header_;
+ extern const char* end_header_;
+ extern const char* start_row_;
+ extern const char* end_row_;
+ extern const char* start_cell_;
+ extern const char* end_cell_;
+ extern const char* funcref_pre_;
+ extern const char* funcref_post_;
+ extern const char* classref_pre_;
+ extern const char* classref_post_;
+ extern const char* memberref_pre_;
+ extern const char* memberref_post_;
+ extern const char* enumref_pre_;
+ extern const char* enumref_post_;
+ extern const char* macroref_pre_;
+ extern const char* macroref_post_;
+ extern const char* headerref_pre_;
+ extern const char* headerref_post_;
+ extern const char* conceptref_pre_;
+ extern const char* conceptref_post_;
+ extern const char* globalref_pre_;
+ extern const char* globalref_post_;
+ extern const char* footnote_pre_;
+ extern const char* footnote_post_;
+ extern const char* escape_pre_;
+ extern const char* escape_post_;
+ extern const char* replaceable_pre_;
+ extern const char* replaceable_post_;
+}
#endif // BOOST_SPIRIT_MARKUPS_HPP
Modified: branches/release/tools/quickbook/detail/post_process.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/post_process.cpp (original)
+++ branches/release/tools/quickbook/detail/post_process.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -8,7 +8,7 @@
=============================================================================*/
#include "./post_process.hpp"
#include "./utils.hpp"
-#include <boost/spirit/core.hpp>
+#include <boost/spirit/include/classic_core.hpp>
#include <boost/bind.hpp>
#include <set>
#include <stack>
@@ -16,7 +16,7 @@
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
using boost::bind;
typedef std::string::const_iterator iter_type;
@@ -417,7 +417,7 @@
int indent;
};
- void post_process(
+ int post_process(
std::string const& in
, std::ostream& out
, int indent
@@ -437,6 +437,7 @@
if (r.full)
{
out << tidy;
+ return 0;
}
else
{
@@ -445,6 +446,7 @@
<< "Warning: Post Processing Failed."
<< std::endl;
out << in;
+ return 1;
}
}
@@ -455,6 +457,7 @@
<< "Warning: Post Processing Failed."
<< std::endl;
out << in;
+ return 1;
}
}
}
Modified: branches/release/tools/quickbook/detail/post_process.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/post_process.hpp (original)
+++ branches/release/tools/quickbook/detail/post_process.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -14,7 +14,7 @@
namespace quickbook
{
- void post_process(
+ int post_process(
std::string const& in
, std::ostream& out
, int indent
Modified: branches/release/tools/quickbook/detail/quickbook.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/quickbook.cpp (original)
+++ branches/release/tools/quickbook/detail/quickbook.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -12,7 +12,8 @@
#include "../doc_info.hpp"
#include "./post_process.hpp"
#include "./utils.hpp"
-#include <boost/spirit/iterator/position_iterator.hpp>
+#include "./input_path.hpp"
+#include <boost/spirit/include/classic_iterator.hpp>
#include <boost/program_options.hpp>
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/operations.hpp>
@@ -31,7 +32,7 @@
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
namespace fs = boost::filesystem;
tm* current_time; // the current time
tm* current_gm_time; // the current UTC time
@@ -56,8 +57,10 @@
std::string storage;
int err = detail::load(filein_, storage);
- if (err != 0)
+ if (err != 0) {
+ ++actor.error_count;
return err;
+ }
typedef position_iterator<std::string::const_iterator> iterator_type;
iterator_type first(storage.begin(), storage.end(), filein_);
@@ -83,10 +86,10 @@
file_position const pos = info.stop.get_position();
detail::outerr(pos.file,pos.line)
<< "Syntax Error near column " << pos.column << ".\n";
- return 1;
+ ++actor.error_count;
}
- return 0;
+ return actor.error_count ? 1 : 0;
}
static int
@@ -120,7 +123,7 @@
result = parse(filein_, outdir, buffer);
if (result == 0)
{
- post_process(buffer.str(), fileout, indent, linewidth);
+ result = post_process(buffer.str(), fileout, indent, linewidth);
}
}
else
@@ -162,11 +165,11 @@
("no-pretty-print", "disable XML pretty printing")
("indent", value<int>(), "indent spaces")
("linewidth", value<int>(), "line width")
- ("input-file", value<std::string>(), "input file")
- ("output-file", value<std::string>(), "output file")
+ ("input-file", value<quickbook::detail::input_path>(), "input file")
+ ("output-file", value<quickbook::detail::input_path>(), "output file")
("debug", "debug mode (for developers)")
("ms-errors", "use Microsoft Visual Studio style error & warn message format")
- ("include-path,I", value< std::vector<std::string> >(), "include path")
+ ("include-path,I", value< std::vector<quickbook::detail::input_path> >(), "include path")
;
positional_options_description p;
@@ -230,17 +233,22 @@
if (vm.count("include-path"))
{
- quickbook::include_path = vm["include-path"].as< std::vector<std::string> >();
+ std::vector<quickbook::detail::input_path> paths
+ = vm["include-path"].as<
+ std::vector<quickbook::detail::input_path> >();
+ quickbook::include_path
+ = std::vector<std::string>(paths.begin(), paths.end());
}
if (vm.count("input-file"))
{
- std::string filein = vm["input-file"].as<std::string>();
+ std::string filein
+ = vm["input-file"].as<quickbook::detail::input_path>();
std::string fileout;
if (vm.count("output-file"))
{
- fileout = vm["output-file"].as<std::string>();
+ fileout = vm["output-file"].as<quickbook::detail::input_path>();
}
else
{
@@ -257,6 +265,7 @@
else
{
quickbook::detail::outerr("",0) << "Error: No filename given" << std::endl;
+ return 1;
}
}
@@ -269,6 +278,7 @@
catch(...)
{
quickbook::detail::outerr("",0) << "Error: Exception of unknown type caught\n";
+ return 1;
}
return 0;
Modified: branches/release/tools/quickbook/detail/template_stack.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/template_stack.cpp (original)
+++ branches/release/tools/quickbook/detail/template_stack.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -25,7 +25,7 @@
{
for (deque::const_iterator i = scopes.begin(); i != scopes.end(); ++i)
{
- if (template_symbol* ts = boost::spirit::find(*i, symbol.c_str()))
+ if (template_symbol* ts = boost::spirit::classic::find(*i, symbol.c_str()))
return ts;
}
return 0;
@@ -33,7 +33,7 @@
template_symbol* template_stack::find_top_scope(std::string const& symbol) const
{
- return boost::spirit::find(scopes.front(), symbol.c_str());
+ return boost::spirit::classic::find(scopes.front(), symbol.c_str());
}
template_symbols const& template_stack::top() const
@@ -45,7 +45,7 @@
void template_stack::add(std::string const& symbol, template_symbol const& ts)
{
BOOST_ASSERT(!scopes.empty());
- boost::spirit::add(scopes.front(), symbol.c_str(), ts);
+ boost::spirit::classic::add(scopes.front(), symbol.c_str(), ts);
}
void template_stack::push()
Modified: branches/release/tools/quickbook/detail/template_stack.hpp
==============================================================================
--- branches/release/tools/quickbook/detail/template_stack.hpp (original)
+++ branches/release/tools/quickbook/detail/template_stack.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -14,9 +14,9 @@
#include <vector>
#include <boost/tuple/tuple.hpp>
#include <boost/assert.hpp>
-#include <boost/spirit/iterator/position_iterator.hpp>
-#include <boost/spirit/utility/functor_parser.hpp>
-#include <boost/spirit/symbols/symbols.hpp>
+#include <boost/spirit/include/classic_position_iterator.hpp>
+#include <boost/spirit/include/classic_functor_parser.hpp>
+#include <boost/spirit/include/classic_symbols.hpp>
#include <boost/next_prior.hpp>
namespace quickbook
@@ -26,16 +26,16 @@
// template name
// template param name[0]
// template param name[1]
- // ...
+ // ...
// template param name[N]
// template body
typedef boost::tuple<
std::vector<std::string>
- , boost::spirit::file_position>
+ , boost::spirit::classic::file_position>
template_symbol;
- typedef boost::spirit::symbols<template_symbol> template_symbols;
+ typedef boost::spirit::classic::symbols<template_symbol> template_symbols;
struct template_stack
{
@@ -43,8 +43,8 @@
struct parser
{
- typedef boost::spirit::nil_t result_t;
-
+ typedef boost::spirit::classic::nil_t result_t;
+
parser(template_stack& ts)
: ts(ts) {}
@@ -58,7 +58,7 @@
for (template_stack::deque::const_iterator i = ts.scopes.begin();
i != ts.scopes.end(); ++i)
{
- boost::spirit::match<> m = i->parse(scan);
+ boost::spirit::classic::match<> m = i->parse(scan);
if (m.length() > len)
len = m.length();
scan.first = f;
@@ -67,7 +67,7 @@
scan.first = boost::next(f, len);
return len;
}
-
+
template_stack& ts;
};
@@ -78,11 +78,11 @@
void add(std::string const& symbol, template_symbol const& ts);
void push();
void pop();
-
- boost::spirit::functor_parser<parser> scope;
+
+ boost::spirit::classic::functor_parser<parser> scope;
private:
-
+
friend struct parser;
deque scopes;
};
Modified: branches/release/tools/quickbook/detail/utils.cpp
==============================================================================
--- branches/release/tools/quickbook/detail/utils.cpp (original)
+++ branches/release/tools/quickbook/detail/utils.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -8,7 +8,7 @@
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#include "./utils.hpp"
-#include <boost/spirit/core.hpp>
+#include <boost/spirit/include/classic_core.hpp>
#include <cctype>
#include <cstring>
@@ -181,6 +181,25 @@
}
}
+ // Copy a string, converting mac and windows style newlines to unix
+ // newlines.
+
+ template <class InputIterator, class OutputIterator>
+ void normalize_newlines(InputIterator begin, InputIterator end,
+ OutputIterator out)
+ {
+ while(begin != end) {
+ if(*begin == '\r') {
+ *out++ = '\n';
+ ++begin;
+ if(begin != end && *begin == '\n') ++begin;
+ }
+ else {
+ *out++ = *begin++;
+ }
+ }
+ }
+
int load(std::string const& filename, std::string& storage)
{
using std::cerr;
@@ -200,7 +219,7 @@
// Turn off white space skipping on the stream
in.unsetf(ios::skipws);
- std::copy(
+ normalize_newlines(
istream_iterator<char>(in),
istream_iterator<char>(),
std::back_inserter(storage));
Modified: branches/release/tools/quickbook/doc_info.hpp
==============================================================================
--- branches/release/tools/quickbook/doc_info.hpp (original)
+++ branches/release/tools/quickbook/doc_info.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -11,14 +11,14 @@
#define BOOST_SPIRIT_QUICKBOOK_DOC_INFO_HPP
#include "./phrase.hpp"
-#include <boost/spirit/core.hpp>
-#include <boost/spirit/actor.hpp>
-#include <boost/spirit/utility/loops.hpp>
-#include <boost/spirit/symbols/symbols.hpp>
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_actor.hpp>
+#include <boost/spirit/include/classic_loops.hpp>
+#include <boost/spirit/include/classic_symbols.hpp>
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
extern unsigned qbk_major_version;
extern unsigned qbk_minor_version;
Modified: branches/release/tools/quickbook/phrase.hpp
==============================================================================
--- branches/release/tools/quickbook/phrase.hpp (original)
+++ branches/release/tools/quickbook/phrase.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -11,15 +11,15 @@
#define BOOST_SPIRIT_QUICKBOOK_PHRASE_HPP
#include "detail/utils.hpp"
-#include <boost/spirit/core.hpp>
-#include <boost/spirit/utility/confix.hpp>
-#include <boost/spirit/utility/chset.hpp>
-#include <boost/spirit/actor/assign_actor.hpp>
-#include <boost/spirit/dynamic/if.hpp>
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_confix.hpp>
+#include <boost/spirit/include/classic_chset.hpp>
+#include <boost/spirit/include/classic_assign_actor.hpp>
+#include <boost/spirit/include/classic_if.hpp>
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
template <typename Rule, typename Action>
inline void
Modified: branches/release/tools/quickbook/syntax_highlight.hpp
==============================================================================
--- branches/release/tools/quickbook/syntax_highlight.hpp (original)
+++ branches/release/tools/quickbook/syntax_highlight.hpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -10,16 +10,17 @@
#if !defined(BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP)
#define BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
-#include <boost/spirit/core.hpp>
-#include <boost/spirit/utility/confix.hpp>
-#include <boost/spirit/utility/chset.hpp>
-#include <boost/spirit/symbols/symbols.hpp>
-#include <boost/spirit/utility/escape_char.hpp>
+#include <boost/spirit/include/classic_core.hpp>
+#include <boost/spirit/include/classic_confix.hpp>
+#include <boost/spirit/include/classic_chset.hpp>
+#include <boost/spirit/include/classic_symbols.hpp>
+#include <boost/spirit/include/classic_escape_char.hpp>
+#include <boost/spirit/include/classic_loops.hpp>
#include "./phrase.hpp"
namespace quickbook
{
- using namespace boost::spirit;
+ using namespace boost::spirit::classic;
// Grammar for C++ highlighting
template <
@@ -58,7 +59,7 @@
| string_ [Process("string", self.out)]
| char_ [Process("char", self.out)]
| number [Process("number", self.out)]
- | anychar_p [Unexpected(self.out)]
+ | repeat_p(1)[anychar_p] [Unexpected(self.out)]
)
;
@@ -74,13 +75,23 @@
)
;
- escape
- = str_p("``") [PreEscape(self.escape_actions, save)]
- >> (
- (+(anychar_p - "``") >> eps_p("``"))
- & qbk_phrase
+ escape =
+ str_p("``") [PreEscape(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(anychar_p - "``") >> eps_p("``"))
+ & qbk_phrase
+ )
+ >> str_p("``")
)
- >> str_p("``") [PostEscape(self.out, self.escape_actions, save)]
+ |
+ (
+ eps_p [self.escape_actions.error]
+ >> *anychar_p
+ )
+ ) [PostEscape(self.out, self.escape_actions, save)]
;
preprocessor
@@ -193,7 +204,7 @@
| special [Process("special", self.out)]
| string_ [Process("string", self.out)]
| number [Process("number", self.out)]
- | anychar_p [Unexpected(self.out)]
+ | repeat_p(1)[anychar_p] [Unexpected(self.out)]
)
;
@@ -209,13 +220,23 @@
)
;
- escape
- = str_p("``") [PreEscape(self.escape_actions, save)]
- >> (
- (+(anychar_p - "``") >> eps_p("``"))
- & qbk_phrase
+ escape =
+ str_p("``") [PreEscape(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(anychar_p - "``") >> eps_p("``"))
+ & qbk_phrase
+ )
+ >> str_p("``")
+ )
+ |
+ (
+ eps_p [self.escape_actions.error]
+ >> *anychar_p
)
- >> str_p("``") [PostEscape(self.out, self.escape_actions, save)]
+ ) [PostEscape(self.out, self.escape_actions, save)]
;
comment
Modified: branches/release/tools/quickbook/test/Jamfile.v2
==============================================================================
--- branches/release/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/release/tools/quickbook/test/Jamfile.v2 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -8,7 +8,7 @@
project test ;
-import quickbook-testing : quickbook-test ;
+import quickbook-testing : quickbook-test quickbook-fail-test ;
test-suite quickbook.test :
[ quickbook-test quickbook-manual ]
@@ -21,4 +21,16 @@
[ quickbook-test templates ]
[ quickbook-test xinclude ]
[ quickbook-test import ]
+ [ quickbook-fail-test fail-include ]
+ [ quickbook-fail-test fail-import ]
+ [ quickbook-fail-test fail-template-arguments1 ]
+ [ quickbook-fail-test fail-template-arguments2 ]
+ [ quickbook-fail-test fail-cpp-mismatched-escape ]
+ [ quickbook-fail-test fail-python-mismatched-escape ]
+ [ quickbook-fail-test fail-post-process ]
+ [ quickbook-fail-test fail-parse-error1 ]
+ [ quickbook-fail-test fail-parse-error2 ]
;
+
+
+
Modified: branches/release/tools/quickbook/test/quickbook-testing.jam
==============================================================================
--- branches/release/tools/quickbook/test/quickbook-testing.jam (original)
+++ branches/release/tools/quickbook/test/quickbook-testing.jam 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -60,6 +60,30 @@
<location-prefix>$(target-name).test
<testing.input-file>$(reference-output)
<testing.input-file>$(target-name).boostbook
+ <preserve-test-targets>on
+ ]
+ ;
+
+ modules.poke testing : .all-tests : \$\(all-tests\) $(t) ;
+
+ return $(t) ;
+}
+
+rule quickbook-fail-test ( target-name : input ? : requirements * )
+{
+ input ?= $(target-name).quickbook ;
+
+ local project = [ project.current ] ;
+ requirements += <testing.arg>$(input:J=" ") ;
+
+ local t =
+ [ targets.create-typed-target RUN_FAIL
+ : $(project)
+ : $(target-name)
+ : ..//quickbook
+ : $(requirements)
+ <preserve-test-targets>on
+ <dependency>$(input)
]
;
@@ -79,3 +103,4 @@
{
$(quickbook-command) $(>) --output-file=$(<) --debug
}
+
Modified: branches/release/tools/quickbook/test/src/text_diff.cpp
==============================================================================
--- branches/release/tools/quickbook/test/src/text_diff.cpp (original)
+++ branches/release/tools/quickbook/test/src/text_diff.cpp 2009-02-16 19:01:03 EST (Mon, 16 Feb 2009)
@@ -10,10 +10,10 @@
#include <iostream>
#include <iterator>
-#include <boost/spirit/core/scanner/scanner.hpp>
-#include <boost/spirit/core/primitives/primitives.hpp>
+#include <boost/spirit/include/classic_scanner.hpp>
+#include <boost/spirit/include/classic_primitives.hpp>
-namespace spirit = boost::spirit;
+namespace spirit = boost::spirit::classic;
typedef std::istream_iterator<char, char> iterator;
typedef spirit::scanner<iterator> scanner;
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