|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72698 - in branches/quickbook-dev/tools: . boostbook/dtd/1.1 boostbook/test/doxygen boostbook/test/doxygen/boost boostbook/test/more/tests/libs boostbook/test/more/tests/misc boostbook/xsl boostbook/xsl/doxygen build/v2 build/v2/build build/v2/doc/src build/v2/engine build/v2/test build/v2/tools build/v2/tools/types doc-guide quickbook quickbook/doc quickbook/src quickbook/test quickbook/test/include quickbook/test/snippets quickbook/test/src quickbook/test/unit regression/src release wave
From: dnljms_at_[hidden]
Date: 2011-06-20 15:20:02
Author: danieljames
Date: 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
New Revision: 72698
URL: http://svn.boost.org/trac/boost/changeset/72698
Log:
Merge tools directory from trunk.
Added:
branches/quickbook-dev/tools/boostbook/dtd/1.1/boost-no-inspect
- copied unchanged from r72670, /trunk/tools/boostbook/dtd/1.1/boost-no-inspect
branches/quickbook-dev/tools/boostbook/test/doxygen/autodoc.gold
- copied unchanged from r72670, /trunk/tools/boostbook/test/doxygen/autodoc.gold
branches/quickbook-dev/tools/boostbook/test/more/tests/misc/
- copied from r72670, /trunk/tools/boostbook/test/more/tests/misc/
branches/quickbook-dev/tools/boostbook/test/more/tests/misc/processing.gold
- copied unchanged from r72670, /trunk/tools/boostbook/test/more/tests/misc/processing.gold
branches/quickbook-dev/tools/boostbook/test/more/tests/misc/processing.xml
- copied unchanged from r72670, /trunk/tools/boostbook/test/more/tests/misc/processing.xml
branches/quickbook-dev/tools/build/v2/test/preprocessor.py
- copied unchanged from r72670, /trunk/tools/build/v2/test/preprocessor.py
branches/quickbook-dev/tools/build/v2/tools/types/preprocessed.jam
- copied unchanged from r72670, /trunk/tools/build/v2/tools/types/preprocessed.jam
branches/quickbook-dev/tools/quickbook/test/code-block-cpp.gold
- copied unchanged from r72670, /trunk/tools/quickbook/test/code-block-cpp.gold
branches/quickbook-dev/tools/quickbook/test/code-block-cpp.quickbook
- copied unchanged from r72670, /trunk/tools/quickbook/test/code-block-cpp.quickbook
branches/quickbook-dev/tools/quickbook/test/code-block-python.gold
- copied unchanged from r72670, /trunk/tools/quickbook/test/code-block-python.gold
branches/quickbook-dev/tools/quickbook/test/code-block-python.quickbook
- copied unchanged from r72670, /trunk/tools/quickbook/test/code-block-python.quickbook
Removed:
branches/quickbook-dev/tools/quickbook/src/syntax_highlight.hpp
Properties modified:
branches/quickbook-dev/tools/ (props changed)
branches/quickbook-dev/tools/doc-guide/ (props changed)
branches/quickbook-dev/tools/quickbook/ (props changed)
branches/quickbook-dev/tools/regression/src/library_status.cpp (props changed)
Text files modified:
branches/quickbook-dev/tools/boostbook/test/doxygen/Jamfile.v2 | 19 +
branches/quickbook-dev/tools/boostbook/test/doxygen/boost/example.hpp | 18 +
branches/quickbook-dev/tools/boostbook/test/more/tests/libs/array.gold | 4
branches/quickbook-dev/tools/boostbook/xsl/docbook.xsl | 4
branches/quickbook-dev/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl | 77 +++++-
branches/quickbook-dev/tools/boostbook/xsl/fo.xsl | 116 +++++++++-
branches/quickbook-dev/tools/boostbook/xsl/reference.xsl | 10
branches/quickbook-dev/tools/boostbook/xsl/template.xsl | 23 +
branches/quickbook-dev/tools/build/v2/Jamroot.jam | 3
branches/quickbook-dev/tools/build/v2/bootstrap.bat | 8
branches/quickbook-dev/tools/build/v2/bootstrap.sh | 5
branches/quickbook-dev/tools/build/v2/build-system.jam | 9
branches/quickbook-dev/tools/build/v2/build/version.jam | 36 ++
branches/quickbook-dev/tools/build/v2/doc/src/reference.xml | 47 +++
branches/quickbook-dev/tools/build/v2/engine/Jambase | 3
branches/quickbook-dev/tools/build/v2/engine/build.jam | 119 ++++++-----
branches/quickbook-dev/tools/build/v2/engine/jambase.c | 3
branches/quickbook-dev/tools/build/v2/engine/patchlevel.h | 16
branches/quickbook-dev/tools/build/v2/tools/builtin.jam | 43 ++++
branches/quickbook-dev/tools/build/v2/tools/clang-linux.jam | 224 +++++++++++---------
branches/quickbook-dev/tools/build/v2/tools/fop.jam | 94 ++------
branches/quickbook-dev/tools/build/v2/tools/gcc.jam | 44 ++++
branches/quickbook-dev/tools/build/v2/tools/intel-linux.jam | 4
branches/quickbook-dev/tools/build/v2/tools/mpi.jam | 1
branches/quickbook-dev/tools/build/v2/tools/msvc.jam | 28 ++
branches/quickbook-dev/tools/quickbook/doc/change_log.qbk | 1
branches/quickbook-dev/tools/quickbook/src/Jamfile.v2 | 1
branches/quickbook-dev/tools/quickbook/src/actions.cpp | 32 +-
branches/quickbook-dev/tools/quickbook/src/actions.hpp | 24 +
branches/quickbook-dev/tools/quickbook/src/actions_class.cpp | 2
branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp | 38 +--
branches/quickbook-dev/tools/quickbook/src/syntax_highlight.cpp | 424 ++++++++++++++++++++++++++++++++++++---
branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 | 2
branches/quickbook-dev/tools/quickbook/test/anchor.gold | 18
branches/quickbook-dev/tools/quickbook/test/include/code-import.gold | 12
branches/quickbook-dev/tools/quickbook/test/include/code-include.gold | 28 +-
branches/quickbook-dev/tools/quickbook/test/include/macros-1.5.gold | 4
branches/quickbook-dev/tools/quickbook/test/include/macros-1.6.gold | 4
branches/quickbook-dev/tools/quickbook/test/link.gold | 2
branches/quickbook-dev/tools/quickbook/test/quickbook-manual.gold | 28 +-
branches/quickbook-dev/tools/quickbook/test/simple_markup.gold | 15
branches/quickbook-dev/tools/quickbook/test/simple_markup.quickbook | 8
branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.cpp | 10
branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.py | 6
branches/quickbook-dev/tools/quickbook/test/src/Jamfile.v2 | 8
branches/quickbook-dev/tools/quickbook/test/table_1_5.gold | 2
branches/quickbook-dev/tools/quickbook/test/unit/Jamfile.v2 | 8
branches/quickbook-dev/tools/quickbook/test/variablelist.gold | 4
branches/quickbook-dev/tools/regression/src/regression.py | 4
branches/quickbook-dev/tools/release/snapshot_download_docs.bat | 9
branches/quickbook-dev/tools/release/snapshot_posix.bat | 6
branches/quickbook-dev/tools/release/snapshot_windows.bat | 6
branches/quickbook-dev/tools/wave/cpp.cpp | 92 +++++---
branches/quickbook-dev/tools/wave/cpp_version.hpp | 4
branches/quickbook-dev/tools/wave/trace_macro_expansion.hpp | 47 +++
55 files changed, 1320 insertions(+), 487 deletions(-)
Modified: branches/quickbook-dev/tools/boostbook/test/doxygen/Jamfile.v2
==============================================================================
--- branches/quickbook-dev/tools/boostbook/test/doxygen/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/boostbook/test/doxygen/Jamfile.v2 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -4,6 +4,7 @@
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import doxygen ;
+import os ;
doxygen autodoc
:
@@ -12,6 +13,24 @@
<xsl:param>"boost.doxygen.reftitle=Example Reference"
;
+if [ os.name ] = NT
+{
+ actions compare
+ {
+ comp /A $(>[1]) $(>[2]) && echo "Stamped" >$(<)
+ }
+
+}
+else
+{
+ actions compare
+ {
+ diff -u -w $(>[1]) $(>[2]) && echo "Stamped" >$(<)
+ }
+}
+
+make check : autodoc.xml autodoc.gold : @compare ;
+
boostbook standalone
:
example.xml
Modified: branches/quickbook-dev/tools/boostbook/test/doxygen/boost/example.hpp
==============================================================================
--- branches/quickbook-dev/tools/boostbook/test/doxygen/boost/example.hpp (original)
+++ branches/quickbook-dev/tools/boostbook/test/doxygen/boost/example.hpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -89,11 +89,29 @@
* void foo() {}
* \endcode
*
+ * \tparam TypeParameter A template parameter
+ * \tparam NonTypeParameter This is a non-type template parameter
+ * \tparam TypeParameterWithDefault This is a template parameter with a default argument
*/
template <typename TypeParameter, int NonTypeParameter,
typename TypeParameterWithDefault = int>
struct example_template {};
+
+ /**
+ * \param i A function parameter
+ * \param j Another
+ * \return The answer
+ * \pre i > j
+ *
+ * This is a test function.
+ * \ref example::example "Link to class"
+ * \ref example_template "Link to class template"
+ * \note This is a note.
+ *
+ * \see example::example and example_template
+ */
+ int namespace_func(int i, int j);
}
#define EXAMPLE(m) The macro
Modified: branches/quickbook-dev/tools/boostbook/test/more/tests/libs/array.gold
==============================================================================
--- branches/quickbook-dev/tools/boostbook/test/more/tests/libs/array.gold (original)
+++ branches/quickbook-dev/tools/boostbook/test/more/tests/libs/array.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -149,7 +149,9 @@
<phrase role="comment">// <link linkend="id35-bb">modifiers</link></phrase>
<phrase role="keyword">void</phrase> <link linkend="id36-bb"><phrase role="identifier">swap</phrase></link><phrase role="special">(</phrase><link linkend="boost.array">array</link><phrase role="special"><</phrase><phrase role="identifier">T</phrase><phrase role="special">,</phrase> <phrase role="identifier">N</phrase><phrase role="special">></phrase><phrase role="special">&</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase>
<phrase role="keyword">void</phrase> <link linkend="id37-bb"><phrase role="identifier">assign</phrase></link><phrase role="special">(</phrase><phrase role="keyword">const</phrase> <phrase role="identifier">T</phrase><phrase role="special">&</phrase><phrase role="special">)</phrase><phrase role="special">;</phrase>
- <phrase role="identifier">T</phrase> elems[N]<phrase role="special">;</phrase>
+
+ <phrase role="comment">// public data members</phrase>
+ <phrase role="identifier">T</phrase> <phrase role="identifier">elems[N]</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase><phrase role="special">;</phrase>
<phrase role="comment">// <link linkend="id38-bb">specialized algorithms</link></phrase>
Modified: branches/quickbook-dev/tools/boostbook/xsl/docbook.xsl
==============================================================================
--- branches/quickbook-dev/tools/boostbook/xsl/docbook.xsl (original)
+++ branches/quickbook-dev/tools/boostbook/xsl/docbook.xsl 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -382,6 +382,10 @@
</xsl:element>
</xsl:template>
+ <xsl:template match="processing-instruction()">
+ <xsl:copy/>
+ </xsl:template>
+
<xsl:template match="code">
<computeroutput>
<xsl:apply-templates mode="annotation"/>
Modified: branches/quickbook-dev/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl
==============================================================================
--- branches/quickbook-dev/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl (original)
+++ branches/quickbook-dev/tools/boostbook/xsl/doxygen/doxygen2boostbook.xsl 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -566,6 +566,7 @@
<xsl:template match="param" mode="template">
<xsl:choose>
<xsl:when test="string(type)='class' or string(type)='typename'">
+ <xsl:variable name="name" select="normalize-space(string(declname))"/>
<template-type-parameter>
<xsl:attribute name="name">
<xsl:value-of select="normalize-space(string(declname))"/>
@@ -576,6 +577,13 @@
mode="passthrough"/>
</default>
</xsl:if>
+ <xsl:for-each select="../../detaileddescription//parameterlist[@kind='templateparam']/parameteritem">
+ <xsl:if test="string(parameternamelist/parametername)=$name">
+ <purpose>
+ <xsl:apply-templates select="parameterdescription/para" mode="passthrough"/>
+ </purpose>
+ </xsl:if>
+ </xsl:for-each>
</template-type-parameter>
</xsl:when>
<!-- Doxygen 1.5.8 generates odd xml for template type parameters.
@@ -583,8 +591,11 @@
<xsl:when test="not(declname) and
(starts-with(string(type), 'class ') or starts-with(string(type), 'typename '))">
<template-type-parameter>
- <xsl:attribute name="name">
+ <xsl:variable name="name">
<xsl:value-of select="normalize-space(substring-after(string(type), ' '))"/>
+ </xsl:variable>
+ <xsl:attribute name="name">
+ <xsl:value-of select="$name"/>
</xsl:attribute>
<xsl:if test="defval">
<default>
@@ -592,12 +603,22 @@
mode="passthrough"/>
</default>
</xsl:if>
+ <xsl:for-each select="../../detaileddescription//parameterlist[@kind='templateparam']/parameteritem">
+ <xsl:if test="string(parameternamelist/parametername)=$name">
+ <purpose>
+ <xsl:apply-templates select="parameterdescription/para" mode="passthrough"/>
+ </purpose>
+ </xsl:if>
+ </xsl:for-each>
</template-type-parameter>
</xsl:when>
<xsl:otherwise>
<template-nontype-parameter>
- <xsl:attribute name="name">
+ <xsl:variable name="name">
<xsl:value-of select="normalize-space(string(declname))"/>
+ </xsl:variable>
+ <xsl:attribute name="name">
+ <xsl:value-of select="$name"/>
</xsl:attribute>
<type>
<xsl:apply-templates select="type"/>
@@ -608,6 +629,13 @@
mode="passthrough"/>
</default>
</xsl:if>
+ <xsl:for-each select="../../detaileddescription//parameterlist[@kind='templateparam']/parameteritem">
+ <xsl:if test="string(parameternamelist/parametername)=$name">
+ <purpose>
+ <xsl:apply-templates select="parameterdescription/para" mode="passthrough"/>
+ </purpose>
+ </xsl:if>
+ </xsl:for-each>
</template-nontype-parameter>
</xsl:otherwise>
</xsl:choose>
@@ -1009,12 +1037,6 @@
mode="function-clauses"/>
</throws>
</xsl:if>
- <xsl:variable name="notes" select="*[self::detaileddescription or self::inbodydescription]/para/simplesect[@kind='note' or @kind='attention']"/>
- <xsl:if test="count($notes) > 0">
- <notes>
- <xsl:apply-templates select="$notes" mode="function-clauses"/>
- </notes>
- </xsl:if>
</xsl:template>
<!-- Handle free functions -->
@@ -1254,17 +1276,32 @@
not (@kind='return') and
not (@kind='post') and
not (@kind='attention') and
- not (@kind='note')">
+ not (@kind='see')">
<xsl:apply-templates mode="passthrough"/>
</xsl:if>
</xsl:template>
+ <xsl:template match="para/simplesect[@kind='note' or @kind='attention']" mode="passthrough">
+ <note>
+ <xsl:apply-templates mode="passthrough"/>
+ </note>
+ </xsl:template>
+
<xsl:template match="para/simplesect[@kind='par']" mode="passthrough">
<formalpara>
<xsl:apply-templates mode="passthrough"/>
</formalpara>
</xsl:template>
+ <xsl:template match="para/simplesect[@kind='see']" mode="passthrough">
+ <para>
+ <emphasis role="bold">
+ <xsl:text>See Also:</xsl:text>
+ </emphasis>
+ <xsl:apply-templates mode="passthrough"/>
+ </para>
+ </xsl:template>
+
<xsl:template match="simplesectsep" mode="passthrough">
<xsl:apply-templates mode="passthrough"/>
</xsl:template>
@@ -1315,7 +1352,20 @@
<!-- Ignore ref elements for now, as there is a lot of documentation which
will have incorrect ref elements at the moment -->
<xsl:template match="ref" mode="passthrough">
- <xsl:apply-templates mode="passthrough"/>
+ <xsl:variable name="as-class" select="key('compounds-by-id', @refid)[@kind='class' or @kind='struct']"/>
+ <xsl:choose>
+ <xsl:when test="$as-class">
+ <classname>
+ <xsl:attribute name="alt">
+ <xsl:value-of select="$as-class/compoundname/text()"/>
+ </xsl:attribute>
+ <xsl:value-of select="text()"/>
+ </classname>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates mode="passthrough"/>
+ </xsl:otherwise>
+ </xsl:choose>
</xsl:template>
<!-- Handle function clauses -->
@@ -1335,9 +1385,6 @@
<xsl:apply-templates mode="passthrough"/>
</postconditions>
</xsl:if>
- <xsl:if test="@kind='note' or @kind='attention'">
- <xsl:apply-templates mode="passthrough"/>
- </xsl:if>
</xsl:template>
<xsl:template match="parameterlist" mode="function-clauses">
@@ -1353,8 +1400,8 @@
</classname>
<xsl:text> </xsl:text>
<xsl:apply-templates
- select="parameterdescription/para/text()
- |parameterdescription/para/*"
+ select=".//parameterdescription/para/text()
+ |.//parameterdescription/para/*"
mode="passthrough"/>
</xsl:otherwise>
</xsl:choose>
Modified: branches/quickbook-dev/tools/boostbook/xsl/fo.xsl
Modified: branches/quickbook-dev/tools/boostbook/xsl/reference.xsl
Modified: branches/quickbook-dev/tools/boostbook/xsl/template.xsl
Modified: branches/quickbook-dev/tools/build/v2/Jamroot.jam
Modified: branches/quickbook-dev/tools/build/v2/bootstrap.bat
Modified: branches/quickbook-dev/tools/build/v2/bootstrap.sh
Modified: branches/quickbook-dev/tools/build/v2/build-system.jam
Modified: branches/quickbook-dev/tools/build/v2/build/version.jam
Modified: branches/quickbook-dev/tools/build/v2/doc/src/reference.xml
Modified: branches/quickbook-dev/tools/build/v2/engine/Jambase
Modified: branches/quickbook-dev/tools/build/v2/engine/build.jam
Modified: branches/quickbook-dev/tools/build/v2/engine/jambase.c
Modified: branches/quickbook-dev/tools/build/v2/engine/patchlevel.h
Modified: branches/quickbook-dev/tools/build/v2/tools/builtin.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/clang-linux.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/fop.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/gcc.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/intel-linux.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/mpi.jam
Modified: branches/quickbook-dev/tools/build/v2/tools/msvc.jam
Modified: branches/quickbook-dev/tools/quickbook/doc/change_log.qbk
Modified: branches/quickbook-dev/tools/quickbook/src/Jamfile.v2
Modified: branches/quickbook-dev/tools/quickbook/src/actions.cpp
Modified: branches/quickbook-dev/tools/quickbook/src/actions.hpp
Modified: branches/quickbook-dev/tools/quickbook/src/actions_class.cpp
Modified: branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp
Modified: branches/quickbook-dev/tools/quickbook/src/syntax_highlight.cpp
Deleted: branches/quickbook-dev/tools/quickbook/src/syntax_highlight.hpp
Modified: branches/quickbook-dev/tools/quickbook/test/Jamfile.v2
Modified: branches/quickbook-dev/tools/quickbook/test/anchor.gold
Modified: branches/quickbook-dev/tools/quickbook/test/include/code-import.gold
Modified: branches/quickbook-dev/tools/quickbook/test/include/code-include.gold
Modified: branches/quickbook-dev/tools/quickbook/test/include/macros-1.5.gold
Modified: branches/quickbook-dev/tools/quickbook/test/include/macros-1.6.gold
Modified: branches/quickbook-dev/tools/quickbook/test/link.gold
Modified: branches/quickbook-dev/tools/quickbook/test/quickbook-manual.gold
Modified: branches/quickbook-dev/tools/quickbook/test/simple_markup.gold
Modified: branches/quickbook-dev/tools/quickbook/test/simple_markup.quickbook
Modified: branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.cpp
Modified: branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.py
Modified: branches/quickbook-dev/tools/quickbook/test/src/Jamfile.v2
Modified: branches/quickbook-dev/tools/quickbook/test/table_1_5.gold
Modified: branches/quickbook-dev/tools/quickbook/test/unit/Jamfile.v2
Modified: branches/quickbook-dev/tools/quickbook/test/variablelist.gold
Modified: branches/quickbook-dev/tools/regression/src/regression.py
Modified: branches/quickbook-dev/tools/release/snapshot_download_docs.bat
Modified: branches/quickbook-dev/tools/release/snapshot_posix.bat
Modified: branches/quickbook-dev/tools/release/snapshot_windows.bat
Modified: branches/quickbook-dev/tools/wave/cpp.cpp
Modified: branches/quickbook-dev/tools/wave/cpp_version.hpp
Modified: branches/quickbook-dev/tools/wave/trace_macro_expansion.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
==============================================================================
--- branches/quickbook-dev/tools/boostbook/xsl/fo.xsl (original)
+++ branches/quickbook-dev/tools/boostbook/xsl/fo.xsl 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -18,7 +18,109 @@
<xsl:param name="make.year.ranges" select="1"/>
<xsl:param name="ulink.show" select="0"/>
- <!-- The question and answer templates are copied here from the
+
+ <!--
+ The following code sets which sections start new pages in the PDF document flow.
+
+ The parameter "boost.section.newpage.depth" set how far down the hierarchy the
+ page breaks go. Defaults to 1 (the same as html chunking), in which case only
+ top level sections start a new page, set to a higher value to force nested sections
+ onto new pages as well.
+
+ For top level sections (level 1), we use "break-before" which forces the very first
+ section onto a separate page from the TOC.
+
+ For nested sections (level 2 and greater) we use "break-after" which keeps nested
+ sections together with their enclosing section (rationale: the enclosing section
+ often has nothing but a title, and no content except the nested sections, and we
+ don't want a page break right after a section title!).
+
+ For reference sections, we turn page breaks *off* by setting "refentry.pagebreak" to 0.
+ This is for the same reason we use "break-after" for nested sections - we want reference
+ entries to be on the same page as the title and synopsis which encloses them. Ideally
+ we'd use "break-after" here too, but I can't find an easy to to fix that.
+
+ Finally note that TOC's and Indexes don't get page breaks forced after them.
+ Again there's no easy fix here, *except* for the top level TOC which gets a page break
+ after it thanks to the "break-before" on level 1 sections. Unfortunately this means
+ there's no break after the last section and before the first Index, *unless* the
+ final section has nested sections which may then trigger one!
+
+ We could fix all this by cut-and-pasting the relevant XSL from the stylesheets to here
+ and making sure everything uses "break-after", but whether it's worth it is questionable...?
+
+ -->
+
+ <xsl:param name="boost.section.newpage.depth" select="1"/>
+ <xsl:param name="refentry.pagebreak" select="0"/>
+
+ <xsl:attribute-set name="section.level1.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-before">
+ <xsl:if test="($boost.section.newpage.depth > 0)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 0)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="section.level2.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-after">
+ <xsl:if test="($boost.section.newpage.depth > 1)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 1)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="section.level3.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-after">
+ <xsl:if test="($boost.section.newpage.depth > 2)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 2)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="section.level4.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-after">
+ <xsl:if test="($boost.section.newpage.depth > 3)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 3)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="section.level5.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-after">
+ <xsl:if test="($boost.section.newpage.depth > 4)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 4)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <xsl:attribute-set name="section.level6.properties" use-attribute-sets="section.properties">
+ <xsl:attribute name="break-after">
+ <xsl:if test="($boost.section.newpage.depth > 5)">
+ page
+ </xsl:if>
+ <xsl:if test="not($boost.section.newpage.depth > 5)">
+ auto
+ </xsl:if>
+ </xsl:attribute>
+ </xsl:attribute-set>
+
+ <!-- The question and answer templates are copied here from the
1.61.3 DocBook XSL stylesheets so that we can eliminate the emission
of id attributes in the emitted fo:list-item-label elements. FOP
0.20.5 has problems with these id attributes, and they are otherwise
@@ -289,17 +391,5 @@
<xsl:param name="callout.graphics.path">http://svn.boost.org/svn/boost/trunk/doc/src/images/callouts/>
<xsl:param name="img.src.path">http://svn.boost.org/svn/boost/trunk/doc/html/>
-<!-- Ideally we would use this to force top level sections
- to start on a new page, unfortunately this causes rather
- unfortunate page breaks in some Doxygen-generated
- documentation which uses <refentry> and <synopsis>
- sections :-(
-
-<xsl:attribute-set name="section.level1.properties">
- <xsl:attribute name="break-before">page</xsl:attribute>
-</xsl:attribute-set>
-
--->
-
</xsl:stylesheet>
==============================================================================
--- branches/quickbook-dev/tools/boostbook/xsl/reference.xsl (original)
+++ branches/quickbook-dev/tools/boostbook/xsl/reference.xsl 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -160,13 +160,19 @@
<xsl:param name="prefix"/>
<xsl:apply-templates mode="comment">
<xsl:with-param name="wrap"
- select="$wrap and count(*) = 0 and count(text()) = 1"/>
+ select="$wrap and count(text()|*) = 1"/>
<xsl:with-param name="prefix" select="$prefix"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="simpara|para" mode="comment">
- <xsl:apply-templates select="text()|*" mode="comment"/>
+ <xsl:param name="wrap" select="false()"/>
+ <xsl:param name="prefix"/>
+ <xsl:apply-templates select="text()|*" mode="comment">
+ <xsl:with-param name="wrap"
+ select="$wrap and count(text()|*) = 1"/>
+ <xsl:with-param name="prefix" select="$prefix"/>
+ </xsl:apply-templates>
</xsl:template>
<xsl:template match="text()" mode="comment">
==============================================================================
--- branches/quickbook-dev/tools/boostbook/xsl/template.xsl (original)
+++ branches/quickbook-dev/tools/boostbook/xsl/template.xsl 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -285,11 +285,30 @@
<!-- Display the comment -->
<xsl:if test="$parameter/purpose">
+ <xsl:variable name="param-text">
+ <!-- Display the parameter -->
+ <xsl:call-template name="template.parameter">
+ <xsl:with-param name="parameter" select="$parameter"/>
+ <xsl:with-param name="is-last" select="not($rest)"/>
+ <xsl:with-param name="highlight" select="false()"/>
+ </xsl:call-template>
+ </xsl:variable>
<xsl:call-template name="highlight-comment">
<xsl:with-param name="text">
<xsl:text> // </xsl:text>
- <xsl:apply-templates
- select="$parameter/purpose/*|$parameter/purpose/text()"/>
+ <xsl:apply-templates
+ select="$parameter/purpose/*|$parameter/purpose/text()" mode="comment">
+ <xsl:with-param name="wrap" select="true()"/>
+ <xsl:with-param name="prefix">
+ <xsl:call-template name="indent">
+ <xsl:with-param name="indentation" select="$indentation + string-length($param-text)"/>
+ </xsl:call-template>
+ <xsl:if test="$rest">
+ <xsl:text> </xsl:text>
+ </xsl:if>
+ <xsl:text> // </xsl:text>
+ </xsl:with-param>
+ </xsl:apply-templates>
</xsl:with-param>
</xsl:call-template>
</xsl:if>
==============================================================================
--- branches/quickbook-dev/tools/build/v2/Jamroot.jam (original)
+++ branches/quickbook-dev/tools/build/v2/Jamroot.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -15,13 +15,14 @@
package.install boost-build-engine boost-build
: # properties
: # binaries
- bjam$(ext)
+ b2$(ext) bjam$(ext)
;
local e1 = [ path.glob-tree $(SELF)/example : * : . .svn ] ;
local e2 ;
for e in $(e1)
{
+ e = [ path.native $(e) ] ;
if [ CHECK_IF_FILE $(e) ]
{
e2 += $(e) ;
==============================================================================
--- branches/quickbook-dev/tools/build/v2/bootstrap.bat (original)
+++ branches/quickbook-dev/tools/build/v2/bootstrap.bat 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -14,11 +14,13 @@
@ECHO OFF
cd ..
-if exist ".\engine\bin.ntx86\bjam.exe" (
+if exist ".\engine\bin.ntx86\b2.exe" (
+ copy .\engine\bin.ntx86\b2.exe . > nul
copy .\engine\bin.ntx86\bjam.exe . > nul
goto :bjam_built)
-if exist ".\engine\bin.ntx86_64\bjam.exe" (
+if exist ".\engine\bin.ntx86_64\b2.exe" (
+ copy .\engine\bin.ntx86_64\b2.exe . > nul
copy .\engine\bin.ntx86_64\bjam.exe . > nul
goto :bjam_built)
@@ -29,7 +31,7 @@
ECHO.
ECHO Bootstrapping is done. To build, run:
ECHO.
-ECHO .\bjam --prefix=DIR install
+ECHO .\b2 --prefix=DIR install
ECHO.
goto :end
==============================================================================
--- branches/quickbook-dev/tools/build/v2/bootstrap.sh (original)
+++ branches/quickbook-dev/tools/build/v2/bootstrap.sh 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -105,15 +105,16 @@
fi
cd "$pwd"
arch=`cd $my_dir/engine && ./bootstrap/jam0 -d0 -f build.jam --toolset=$TOOLSET --toolset-root= --show-locate-target && cd ..`
- BJAM="$my_dir/engine/$arch/bjam"
+ BJAM="$my_dir/engine/$arch/b2"
echo "engine/$arch/bjam"
cp "$BJAM" .
+ cp "$my_dir/engine/$arch/bjam" .
fi
cat << EOF
Bootstrapping is done. To build and install, run:
- ./bjam install --prefix=<DIR>
+ ./b2 install --prefix=<DIR>
EOF
==============================================================================
--- branches/quickbook-dev/tools/build/v2/build-system.jam (original)
+++ branches/quickbook-dev/tools/build/v2/build-system.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -543,14 +543,15 @@
#
################################################################################
-{
+{
if --version in $(.argv)
{
version.print ;
EXIT ;
}
-
-
+
+ version.verify-engine-version ;
+
load-configuration-files ;
local extra-properties ;
@@ -771,7 +772,6 @@
# Prepare valid XML header and footer with some basic info.
local nl = "
" ;
- local jam = [ version.jam ] ;
local os = [ modules.peek : OS OSPLAT JAMUNAME ] "" ;
local timestamp = [ modules.peek : JAMDATE ] ;
local cwd = [ PWD ] ;
@@ -780,7 +780,6 @@
.header on $(xml-file) =
"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
"$(nl)<build format=\"1.0\" version=\"$(bb-version)\">"
- "$(nl) <jam version=\"$(jam:J=.)\" />"
"$(nl) <os name=\"$(os[1])\" platform=\"$(os[2])\"><![CDATA[$(os[3-]:J= )]]></os>"
"$(nl) <timestamp><![CDATA[$(timestamp)]]></timestamp>"
"$(nl) <directory><![CDATA[$(cwd)]]></directory>"
==============================================================================
--- branches/quickbook-dev/tools/build/v2/build/version.jam (original)
+++ branches/quickbook-dev/tools/build/v2/build/version.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -6,27 +6,45 @@
import errors ;
import numbers ;
+major = "2011" ;
+minor = "04" ;
rule boost-build ( )
{
- return "V2 (Milestone 12)" ;
+ return "$(major).$(minor)-svn" ;
}
-
-rule jam ( )
+rule print ( )
{
- local v = [ modules.peek : JAM_VERSION ] ;
- return $(v:J=.) ;
+ if [ verify-engine-version ]
+ {
+ ECHO "Boost.Build" [ boost-build ] ;
+ }
}
-
-rule print ( )
+rule verify-engine-version ( )
{
- ECHO "Boost.Build" [ boost-build ] ;
- ECHO "Boost.Jam" [ jam ] ;
+ local v = [ modules.peek : JAM_VERSION ] ;
+
+ if $(v[1]) != $(major) || $(v[2]) != $(minor)
+ {
+ local argv = [ modules.peek : ARGV ] ;
+ local e = $(argv[1]) ;
+ local l = [ modules.binding version ] ;
+ l = $(l:D) ;
+ l = $(l:D) ;
+ ECHO "warning: mismatched versions of Boost.Build engine and core" ;
+ ECHO "warning: Boost.Build engine ($(e)) is $(v:J=.)" ;
+ ECHO "warning: Boost.Build core (at $(l)) is" [ boost-build ] ;
+ }
+ else
+ {
+ return true ;
+ }
}
+
# Utility rule for testing whether all elements in a sequence are equal to 0.
#
local rule is-all-zeroes ( sequence * )
==============================================================================
--- branches/quickbook-dev/tools/build/v2/doc/src/reference.xml (original)
+++ branches/quickbook-dev/tools/build/v2/doc/src/reference.xml 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -119,6 +119,14 @@
</varlistentry>
<varlistentry>
+ <term><literal>preprocessed</literal></term>
+ <indexterm><primary>preprocessed</primary></indexterm>
+
+ <listitem><para>Creates an preprocessed source file. The arguments follow the
+ <link linkend="bbv2.main-target-rule-syntax">common syntax</link>.</para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term><literal>glob</literal></term>
<listitem><para>The <code>glob</code> rule takes a list shell pattern
@@ -266,6 +274,7 @@
<variablelist>
<varlistentry><term><literal>variant</literal></term>
+ <indexterm><primary>variant</primary></indexterm>
<listitem>
<para>
@@ -321,6 +330,7 @@
<varlistentry id="bbv2.overview.builtins.features.link">
<term><literal>link</literal></term>
+ <indexterm><primary>link</primary></indexterm>
<listitem>
@@ -356,6 +366,7 @@
<varlistentry>
<term><literal>threading</literal></term>
+ <indexterm><primary>threading</primary></indexterm>
<listitem>
@@ -373,7 +384,9 @@
</listitem>
</varlistentry>
- <varlistentry><term><literal>source</literal></term>
+ <varlistentry>
+ <term><literal>source</literal></term>
+ <indexterm><primary>source</primary></indexterm>
<listitem>
<simpara>
@@ -388,7 +401,9 @@
</listitem>
</varlistentry>
- <varlistentry><term><literal>library</literal></term>
+ <varlistentry>
+ <term><literal>library</literal></term>
+ <indexterm><primary>library</primary></indexterm>
<listitem>
<simpara>
@@ -404,6 +419,7 @@
<varlistentry><term><anchor id="bbv2.builtin.features.dependency"/>
<literal>dependency</literal></term>
+ <indexterm><primary>dependency</primary></indexterm>
<listitem>
<simpara>
@@ -442,6 +458,7 @@
<varlistentry><term><anchor id="bbv2.builtin.features.use"/>
<literal>use</literal></term>
+ <indexterm><primary>use</primary></indexterm>
<listitem>
<simpara>
@@ -460,8 +477,10 @@
</listitem>
</varlistentry>
- <varlistentry><term><anchor id="bbv2.reference.features.dll-path"/>
- <literal>dll-path</literal></term>
+ <varlistentry>
+ <term><anchor id="bbv2.reference.features.dll-path"/>
+ <literal>dll-path</literal></term>
+ <indexterm><primary>dll-path</primary></indexterm>
<listitem>
<simpara>
@@ -473,7 +492,9 @@
</simpara>
</listitem></varlistentry>
- <varlistentry><term><literal>hardcode-dll-paths</literal></term>
+ <varlistentry>
+ <term><literal>hardcode-dll-paths</literal></term>
+ <indexterm><primary>hardcode-dll-paths</primary></indexterm>
<listitem>
<simpara>
@@ -514,6 +535,7 @@
<varlistentry>
<term><literal>include</literal></term>
+ <indexterm><primary>include</primary></indexterm>
<listitem>
<simpara>
@@ -523,6 +545,21 @@
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><literal>define</literal></term>
+ <indexterm><primary>define</primary></indexterm>
+
+ <listitem>
+ <simpara>
+ Specifies an preprocessor symbol that should be defined on the command
+ line. You may either specify just the symbol, which will be defined
+ without any value, or both the symbol and the value, separated by
+ equal sign.
+ </simpara>
+ </listitem>
+ </varlistentry>
+
+
<varlistentry><term><literal>warnings</literal></term>
<listitem>
<simpara>
==============================================================================
--- branches/quickbook-dev/tools/build/v2/engine/Jambase (original)
+++ branches/quickbook-dev/tools/build/v2/engine/Jambase 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -118,7 +118,8 @@
}
-if [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]
+if [ MATCH .*(b2).* : $(ARGV[1]:BL) ]
+ || [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]
|| $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1.
{
# We attempt to load "boost-build.jam" by searching from the current
==============================================================================
--- branches/quickbook-dev/tools/build/v2/engine/build.jam (original)
+++ branches/quickbook-dev/tools/build/v2/engine/build.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -17,12 +17,12 @@
}
# Platform related specifics.
-if $(NT) { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; }
-else if $(OS2) { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; }
-else if $(VMS) { rule .path { return "[.$(<:J=/)]" ; } }
-else if $(MAC) { rule .path { return ":$(<:J=\:)" ; } }
+if $(OS) = NT { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; }
+else if $(OS) = OS2 { rule .path { return "$(<:J=\\)" ; } ./ = "/" ; }
+else if $(OS) = VMS { rule .path { return "[.$(<:J=/)]" ; } }
+else if $(OS) = MAC { rule .path { return ":$(<:J=\:)" ; } }
else { rule .path { return "$(<:J=/)" ; } }
-if $(VMS) { . = "_" ; }
+if $(OS) = VMS { . = "_" ; }
else { . = "." ; }
./ ?= "" ;
@@ -67,7 +67,7 @@
}
if $(with-python)
{
- if $(NT)
+ if $(OS) = NT
{
--python-include = [ .path $(python-location) include ] ;
--python-lib = ;
@@ -261,7 +261,7 @@
## Metrowerks CodeWarrior 8.x
{
# Even though CW can compile all files at once, it crashes if it tries in the bjam case.
- local mwcc = ; if $(NT) { mwcc = mwcc ; } else { mwcc = mwc$(OSPLAT:L) ; }
+ local mwcc = ; if $(OS) = NT { mwcc = mwcc ; } else { mwcc = mwc$(OSPLAT:L) ; }
mwcc ?= mwcc ;
toolset metrowerks $(mwcc) : "-o " : -D
: -c -lang c -subsystem console -cwd include
@@ -454,12 +454,12 @@
# Put executables in platform-specific subdirectory.
locate-target = $(LOCATE_TARGET) ;
-if $(VMS)
+if $(OS) = VMS
{
locate-target ?= bin$(.)vms ;
platform = vms ;
}
-else if $(MAC)
+else if $(OS) = MAC
{
locate-target ?= bin$(.)$(OS:L)$(OSPLAT:L) ;
platform = $(OS:L)$(OSPLAT:L) ;
@@ -505,19 +505,19 @@
modules/path.c modules/regex.c modules/property-set.c
modules/sequence.c modules/order.c
;
-if $(NT)
+if $(OS) = NT
{
jam.source += execnt.c filent.c pathunix.c ;
}
-else if $(OS2)
+else if $(OS) = OS2
{
jam.source += execunix.c fileos2.c pathunix.c ;
}
-else if $(VMS)
+else if $(OS) = VMS
{
jam.source += execvms.c filevms.c pathvms.c ;
}
-else if $(MAC)
+else if $(OS) = MAC
{
jam.source += execmac.c filemac.c pathmac.c ;
}
@@ -561,11 +561,11 @@
--defs += OPT_DUMA ;
}
-if ( $(OS) = NT || $(NT) ) && ! NT in $(--defs)
+if ( $(OS) = NT ) && ! NT in $(--defs)
{
--defs += NT ;
}
-if $(VMS)
+if $(OS) = VMS
{
--defs += VMS ;
}
@@ -591,22 +591,22 @@
{
[DELETE] clean : $(<) ;
}
-if $(NT) { actions piecemeal together existing [DELETE] {
+if $(OS) = NT { actions piecemeal together existing [DELETE] {
del /F /Q "$(>)"
} }
-if $(UNIX) { actions piecemeal together existing [DELETE] {
+if $(UNIX) = true { actions piecemeal together existing [DELETE] {
rm -f "$(>)"
} }
-if $(VMS) { actions piecemeal together existing [DELETE] {
+if $(OS) = VMS { actions piecemeal together existing [DELETE] {
DELETE $(>[--2]:J=";*, ") $(>[-1]);*
} }
-if $(NT) {
+if $(OS) = NT {
--chmod+w = "attrib -r " ;
}
-if $(UNIX) {
+if $(UNIX) = true {
--chmod+w = "chmod +w " ;
}
-if $(VMS) {
+if $(OS) = VMS {
--chmod+w = "SET FILE/PROT=(S:RWED) " ;
}
@@ -616,20 +616,20 @@
if $(<:P) { DEPENDS $(<) : $(<:P) ; .mkdir $(<:P) ; }
if ! $(md<$(<)>) { [MKDIR] $(<) ; md<$(<)> = - ; }
}
-if $(NT) { actions [MKDIR] {
+if $(OS) = NT { actions [MKDIR] {
md "$(<)"
} }
-if $(UNIX) { actions [MKDIR] {
+if $(UNIX) = true { actions [MKDIR] {
mkdir "$(<)"
} }
-if $(VMS) { actions [MKDIR] {
+if $(OS) = VMS { actions [MKDIR] {
CREATE/DIR $(<J=", ")
} }
rule .exe
{
local exe = $(<) ;
- if $(NT) || ( $(UNIX) && $(OS) = CYGWIN ) || $(VMS) { exe = $(exe:S=.exe) ; }
+ if $(OS) = NT || ( $(UNIX) = true && $(OS) = CYGWIN ) || $(OS) = VMS { exe = $(exe:S=.exe) ; }
LOCATE on $(exe) = $(locate-target) ;
DEPENDS all : $(exe) ;
.mkdir $(locate-target) ;
@@ -670,7 +670,7 @@
else { actions [COMPILE] {
"$(--cc)" "$(--bin)$(<:D=)" "$(--dir)$(<:D)$(./)" $(--out)$(<) "$(--def[1])$(--defs:J=$(--def[2]))$(--def[3])" "$(--flags)" "$(--libs)" "$(>)"
} }
-if $(VMS) { actions [COMPILE.LINK] {
+if $(OS) = VMS { actions [COMPILE.LINK] {
"$(--link)" $(--link-bin)$(<:D=) $(--link-dir)$(<:D)$(./) $(--link-out)$(<) $(--link-def)$(--link-defs) $(--link-flags) "$(--link-libs)" $(>J=", ")
} }
else { actions [COMPILE.LINK] {
@@ -684,29 +684,43 @@
[LINK] $(<) : $(>) ;
.clean $(<) ;
}
-if $(NT) { actions [LINK] {
+if $(OS) = NT { actions [LINK] {
copy "$(>)" "$(<)"
} }
-if $(UNIX) { actions [LINK] {
+if $(UNIX) = true { actions [LINK] {
ln -fs "$(>)" "$(<)"
} }
-if $(VMS) { actions [LINK] {
+if $(OS) = VMS { actions [LINK] {
COPY/REPLACE $(>) $(<)
} }
+rule .copy
+{
+ DEPENDS all : $(<) ;
+ DEPENDS $(<) : $(>) ;
+ [COPY] $(<) : $(>) ;
+ .clean $(<) ;
+}
+
+# Will be redefined later.
+actions [COPY]
+{
+}
+
+
rule .move
{
DEPENDS $(<) : $(>) ;
[MOVE] $(<) : $(>) ;
}
-if $(NT) { actions [MOVE] {
+if $(OS) = NT { actions [MOVE] {
del /f "$(<)"
rename "$(>)" "$(<)"
} }
-if $(UNIX) { actions [MOVE] {
+if $(UNIX) = true { actions [MOVE] {
mv -f "$(>)" "$(<)"
} }
-if $(VMS) { actions [MOVE] {
+if $(OS) = VMS { actions [MOVE] {
RENAME "$(>)" "$(<)"
} }
@@ -735,7 +749,7 @@
}
# How to build the grammar.
-if $(NT)
+if $(OS) = NT
{
SUFEXE = .exe ;
# try some other likely spellings...
@@ -765,7 +779,7 @@
LEAVES $(<) ;
[YACC] $(<) : $(>) ;
}
-if $(NT) { actions [YACC] {
+if $(OS) = NT { actions [YACC] {
"$(yacc)" "$(>)"
if not errorlevel 1 (
del /f "$(<[1])"
@@ -774,7 +788,7 @@
rename y.tab$(<[2]:S) "$(<[2])"
) else set _error_ =
} }
-if $(UNIX) { actions [YACC] {
+if $(UNIX) = true { actions [YACC] {
if ` "$(yacc)" "$(>)" ` ; then
mv -f y.tab$(<[1]:S) "$(<[1])"
mv -f y.tab$(<[2]:S) "$(<[2])"
@@ -782,7 +796,7 @@
exit 1
fi
} }
-if $(VMS) { actions [YACC] {
+if $(OS) = VMS { actions [YACC] {
IF "$(yacc)" $(>)
THEN
RENAME y_tab$(<[1]:S) $(<[1])
@@ -821,16 +835,15 @@
{
$(>).exe = [ .exe $(>) : $(jam.source) ] ;
DEPENDS all : $($(>).exe) ;
-
- if $(debug)
- {
- $(<).exe = $(<:S=$($(>).exe:S)) ;
- LOCATE on $($(<).exe) = $(locate-target) ;
- .link $($(<).exe) : $($(>).exe) ;
- DEPENDS all : $($(<).exe) ;
- }
+
+ # Make a copy under the old name.
+ $(<).exe = $(<:S=$($(>).exe:S)) ;
+ LOCATE on $($(<).exe) = $(locate-target) ;
+ .copy $($(<).exe) : $($(>).exe) ;
+ DEPENDS all : $($(<).exe) ;
}
-.jam jam : bjam ;
+.jam bjam : b2 ;
+
# Scan sources for header dependencies.
# WARNING: Yes those are *REAL TABS* below. DO NOT CHANGE,
@@ -900,7 +913,7 @@
$(dist.bin:S=$(bjam.exe:S))
;
-if $(NT)
+if $(OS) = NT
{
zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7z.exe" ] ;
zip ?= [ GLOB "$(ProgramFiles:J= )\\7-ZIP" "C:\\Program Files\\7-ZIP" : "7zn.exe" ] ;
@@ -922,7 +935,7 @@
copy /Y "$(>)" "$(<)" >NUL:
}
}
-if $(UNIX)
+if $(UNIX) = true
{
tar ?= [ GLOB $(PATH) : star bsdtar tar ] ;
tar = $(tar[1]) ;
@@ -949,14 +962,14 @@
rule .binary
{
local zip = ;
- if $(NT) { zip = $($(<).exe:S=.zip) ; }
- if $(UNIX) { zip = $($(<).exe:S=.tgz) ; }
+ if $(OS) = NT { zip = $($(<).exe:S=.zip) ; }
+ if $(UNIX) = true { zip = $($(<).exe:S=.tgz) ; }
zip = $(zip:S=)-$(VERSION)-$(RELEASE)-$(platform)$(zip:S) ;
DEPENDS $(zip) : $($(<).exe) ;
DEPENDS dist : $(zip) ;
#~ LOCATE on $(zip) = $(locate-target) ;
- if $(NT) { [ZIP] $(zip) : $($(<).exe) ; }
- if $(UNIX) { [PACK] $(zip) : $($(<).exe) ; }
+ if $(OS) = NT { [ZIP] $(zip) : $($(<).exe) ; }
+ if $(UNIX) = true { [PACK] $(zip) : $($(<).exe) ; }
.clean $(zip) ;
}
@@ -982,8 +995,8 @@
}
local pack = ;
- if $(NT) { pack = $(dst-dir).zip ; }
- if $(UNIX) { pack = $(dst-dir).tgz ; }
+ if $(OS) = NT { pack = $(dst-dir).zip ; }
+ if $(UNIX) = true { pack = $(dst-dir).tgz ; }
DEPENDS dist : $(pack) ;
DEPENDS $(pack) : $(dst-files) ;
==============================================================================
--- branches/quickbook-dev/tools/build/v2/engine/jambase.c (original)
+++ branches/quickbook-dev/tools/build/v2/engine/jambase.c 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -64,7 +64,8 @@
"}\n",
"include $(.bootstrap-file) ;\n",
"}\n",
-"if [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]\n",
+"if [ MATCH .*(b2).* : $(ARGV[1]:BL) ] \n",
+"|| [ MATCH .*(bjam).* : $(ARGV[1]:BL) ]\n",
"|| $(BOOST_ROOT) # A temporary measure so Jam works with Boost.Build v1.\n",
"{\n",
"local search-path = $(BOOST_BUILD_PATH) $(BOOST_ROOT) ;\n",
==============================================================================
--- branches/quickbook-dev/tools/build/v2/engine/patchlevel.h (original)
+++ branches/quickbook-dev/tools/build/v2/engine/patchlevel.h 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -7,11 +7,11 @@
/* Keep JAMVERSYM in sync with VERSION. */
/* It can be accessed as $(JAMVERSION) in the Jamfile. */
-#define VERSION_MAJOR 3
-#define VERSION_MINOR 1
-#define VERSION_PATCH 19
-#define VERSION_MAJOR_SYM "03"
-#define VERSION_MINOR_SYM "1"
-#define VERSION_PATCH_SYM "19"
-#define VERSION "3.1.19"
-#define JAMVERSYM "JAMVERSION=3.1"
+#define VERSION_MAJOR 2011
+#define VERSION_MINOR 04
+#define VERSION_PATCH 0
+#define VERSION_MAJOR_SYM "2011"
+#define VERSION_MINOR_SYM "04"
+#define VERSION_PATCH_SYM "00"
+#define VERSION "2011.4"
+#define JAMVERSYM "JAMVERSION=2011.4"
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/builtin.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/builtin.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -26,6 +26,7 @@
import symlink ;
import toolset ;
import type ;
+import targets ;
import types/register ;
import utility ;
import virtual-target ;
@@ -603,6 +604,48 @@
generators.override builtin.prebuilt : builtin.lib-generator ;
+class preprocessed-target-class : basic-target
+{
+ import generators ;
+ rule construct ( name : sources * : property-set )
+ {
+ local result = [ generators.construct [ project ]
+ $(name) : PREPROCESSED_CPP : $(property-set) : $(sources) ] ;
+ if ! $(result)
+ {
+ result = [ generators.construct [ project ]
+ $(name) : PREPROCESSED_C : $(property-set) : $(sources) ] ;
+ }
+ if ! $(result)
+ {
+ local s ;
+ for x in $(sources)
+ {
+ s += [ $(x).name ] ;
+ }
+ local p = [ project ] ;
+ errors.user-error
+ "In project" [ $(p).name ] :
+ "Could not construct preprocessed file \"$(name)\" from $(s:J=, )." ;
+ }
+ return $(result) ;
+ }
+}
+
+rule preprocessed ( name : sources * : requirements * : default-build * :
+ usage-requirements * )
+{
+ local project = [ project.current ] ;
+ return [ targets.main-target-alternative
+ [ new preprocessed-target-class $(name) : $(project)
+ : [ targets.main-target-sources $(sources) : $(name) ]
+ : [ targets.main-target-requirements $(r) : $(project) ]
+ : [ targets.main-target-default-build $(default-build) : $(project) ]
+ : [ targets.main-target-usage-requirements $(usage-requirements) : $(project) ]
+ ] ] ;
+}
+
+IMPORT $(__name__) : preprocessed : : preprocessed ;
class compile-action : action
{
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/clang-linux.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/clang-linux.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1,5 +1,5 @@
-# Copyright (c) 2003 Michael Stevens
-# Copyright (c) 2011 Bryce Lelbach
+# Copyright (c) 2003 Michael Stevens
+# Copyright (c) 2010-2011 Bryce Lelbach (blelbach_at_[hidden], maintainer)
#
# Use, modification and distribution is subject to the Boost Software
# License Version 1.0. (See accompanying file LICENSE_1_0.txt or
@@ -20,64 +20,60 @@
feature.extend-subfeature toolset clang : platform : linux ;
toolset.inherit-generators clang-linux
- <toolset>clang <toolset-clang:platform>linux : gcc
- : gcc.mingw.link gcc.mingw.link.dll gcc.cygwin.link gcc.cygwin.link.dll gcc.compile.c.pch gcc.compile.c++.pch ;
+ <toolset>clang <toolset-clang:platform>linux : gcc
+ : gcc.mingw.link gcc.mingw.link.dll gcc.cygwin.link gcc.cygwin.link.dll ;
generators.override clang-linux.prebuilt : builtin.lib-generator ;
generators.override clang-linux.prebuilt : builtin.prebuilt ;
generators.override clang-linux.searched-lib-generator : searched-lib-generator ;
# Override default do-nothing generators.
-# FIXME: disabled for now
-#generators.override clang-linux.compile.c.pch : pch.default-c-pch-generator ;
-#generators.override clang-linux.compile.c++.pch : pch.default-cpp-pch-generator ;
+generators.override clang-linux.compile.c.pch : pch.default-c-pch-generator ;
+generators.override clang-linux.compile.c++.pch : pch.default-cpp-pch-generator ;
-#type.set-generated-target-suffix PCH : <toolset>clang <toolset-clang:platform>linux : pchc ;
+type.set-generated-target-suffix PCH
+ : <toolset>clang <toolset-clang:platform>linux : pth ;
toolset.inherit-rules clang-linux : gcc ;
toolset.inherit-flags clang-linux : gcc
- : <inlining>off <inlining>on <inlining>full
- <optimization>space <optimization>speed
- <warnings>off <warnings>all <warnings>on
- ;
+ : <inlining>off <inlining>on <inlining>full
+ <optimization>space <optimization>speed
+ <warnings>off <warnings>all <warnings>on ;
-if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ]
-{
- .debug-configuration = true ;
+if [ MATCH (--debug-configuration) : [ modules.peek : ARGV ] ] {
+ .debug-configuration = true ;
}
-# Initializes the clang-linux toolset
-# version in optional
-# name (default clang++) is used to invoke the specified clanglinux complier
-# compile and link options allow you to specify addition command line options for each version
-rule init ( version ? : command * : options * )
-{
- command = [ common.get-invocation-command clang-linux : clang++
- : $(command) ] ;
+rule init ( version ? : command * : options * ) {
+ command = [ common.get-invocation-command clang-linux : clang++
+ : $(command) ] ;
- # Determine the version
- local command-string = $(command:J=" ") ;
- if $(command)
- {
- version ?= [ MATCH "^([0-9.]+)"
- : [ SHELL "$(command-string) -dumpversion" ] ] ;
- }
+ # Determine the version
+ local command-string = $(command:J=" ") ;
- local condition = [ common.check-init-parameters clang-linux
- : version $(version) ] ;
-
- common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
+ if $(command) {
+ version ?= [ MATCH "version ([0-9.]+)"
+ : [ SHELL "$(command-string) --version" ] ] ;
+ }
- gcc.init-link-flags clang-linux gnu $(condition) ;
+ local condition = [ common.check-init-parameters clang-linux
+ : version $(version) ] ;
+ common.handle-options clang-linux : $(condition) : $(command) : $(options) ;
+
+ gcc.init-link-flags clang-linux gnu $(condition) ;
}
-SPACE = " " ;
+###############################################################################
+# Flags
+
+toolset.flags clang-linux.compile OPTIONS <cflags> ;
+toolset.flags clang-linux.compile OPTIONS <cxxflags> ;
-# Declare flags and action for compilation.
toolset.flags clang-linux.compile OPTIONS <optimization>off : ;
toolset.flags clang-linux.compile OPTIONS <optimization>speed : -O3 ;
toolset.flags clang-linux.compile OPTIONS <optimization>space : -Os ;
+# note: clang silently ignores some of these inlining options
toolset.flags clang-linux.compile OPTIONS <inlining>off : -fno-inline ;
toolset.flags clang-linux.compile OPTIONS <inlining>on : -Wno-inline ;
toolset.flags clang-linux.compile OPTIONS <inlining>full : -finline-functions -Wno-inline ;
@@ -88,93 +84,113 @@
toolset.flags clang-linux.compile OPTIONS <warnings-as-errors>on : -Werror ;
toolset.flags clang-linux.compile OPTIONS <debug-symbols>on : -g ;
-toolset.flags clang-linux.compile OPTIONS <profiling>on : ;
+toolset.flags clang-linux.compile OPTIONS <profiling>on : -pg ;
toolset.flags clang-linux.compile OPTIONS <rtti>off : -fno-rtti ;
-#rule compile.c++ ( targets * : sources * : properties * )
-#{
-# gcc.setup-threading $(targets) : $(sources) : $(properties) ;
-# gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
-# gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-# DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
-#}
+###############################################################################
+# C and C++ compilation
-#actions compile.c++ bind PCH_FILE
-actions compile.c++
-{
-# "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pch -Xclang "$(PCH_FILE)" -c -o "$(<)" "$(>)"
- "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+rule compile.c++ ( targets * : sources * : properties * ) {
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+
+ local pth-file = [ on $(<) return $(PCH_FILE) ] ;
+
+ if $(pth-file) {
+ DEPENDS $(<) : $(pth-file) ;
+ compile.c++.with-pch $(targets) : $(sources) ;
+ }
+ else {
+ compile.c++.without-pth $(targets) : $(sources) ;
+ }
}
-#rule compile.c ( targets * : sources * : properties * )
-#{
-# gcc.setup-threading $(targets) : $(sources) : $(properties) ;
-# gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
-# gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-# DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
-#}
+actions compile.c++.without-pth {
+ "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -o "$(<)" "$(>)"
+}
-#actions compile.c bind PCH_FILE
-actions compile.c
+actions compile.c++.with-pch bind PCH_FILE
{
-# "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pch -Xclang "$(PCH_FILE)" -c -o "$(<)" "$(>)"
- "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
+ "$(CONFIG_COMMAND)" -c -x c++ $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -o "$(<)" "$(>)"
}
-#rule compile.c++.pch ( targets * : sources * : properties * )
-#{
-# gcc.setup-threading $(targets) : $(sources) : $(properties) ;
-# gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
-# gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-#}
-
-# Compiling a pch first deletes any existing *.pchc file, as Clang's compiler
-# won't over-write an existing pch: instead it creates filename$1.pchc, filename$2.pchc
-# etc - which appear not to do anything except take up disk space :-(
-
-#actions compile.c++.pch
-#{
-# rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pch -o "$(<)" "$(>)"
-#}
-
-#rule compile.c.pch ( targets * : sources * : properties * )
-#{
-# gcc.setup-threading $(targets) : $(sources) : $(properties) ;
-# gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
-# gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
-#}
-
-#actions compile.c.pch
-#{
-# rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pch -o "$(<)" "$(>)"
-#}
-
-rule link ( targets * : sources * : properties * )
+rule compile.c ( targets * : sources * : properties * )
{
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
- SPACE on $(targets) = " " ;
- JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+
+ local pth-file = [ on $(<) return $(PCH_FILE) ] ;
+
+ if $(pth-file) {
+ DEPENDS $(<) : $(pth-file) ;
+ compile.c.with-pch $(targets) : $(sources) ;
+ }
+ else {
+ compile.c.without-pth $(targets) : $(sources) ;
+ }
}
-actions link bind LIBRARIES
+actions compile.c.without-pth
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
+ "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
-rule link.dll ( targets * : sources * : properties * )
+actions compile.c.with-pch bind PCH_FILE
{
- gcc.setup-threading $(targets) : $(sources) : $(properties) ;
- gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
- SPACE on $(targets) = " " ;
- JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
+ "$(CONFIG_COMMAND)" -c -x c $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -include-pth -Xclang "$(PCH_FILE)" -c -o "$(<)" "$(>)"
}
-# Differ from 'link' above only by -shared.
-actions link.dll bind LIBRARIES
+###############################################################################
+# PCH emission
+
+rule compile.c++.pch ( targets * : sources * : properties * ) {
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+}
+
+actions compile.c++.pch {
+ rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c++-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
+}
+
+rule compile.c.pch ( targets * : sources * : properties * ) {
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-fpic $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+}
+
+actions compile.c.pch
{
- "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
+ rm -f "$(<)" && "$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -Xclang -emit-pth -o "$(<)" "$(>)"
}
+###############################################################################
+# Linking
+SPACE = " " ;
+
+rule link ( targets * : sources * : properties * ) {
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+ SPACE on $(targets) = " " ;
+ JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
+}
+
+actions link bind LIBRARIES {
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -Wl,-rpath-link$(SPACE)-Wl,"$(RPATH_LINK)" -o "$(<)" "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
+}
+
+rule link.dll ( targets * : sources * : properties * ) {
+ gcc.setup-threading $(targets) : $(sources) : $(properties) ;
+ gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
+ SPACE on $(targets) = " " ;
+ JAM_SEMAPHORE on $(targets) = <s>clang-linux-link-semaphore ;
+}
+
+# Differ from 'link' above only by -shared.
+actions link.dll bind LIBRARIES {
+ "$(CONFIG_COMMAND)" -L"$(LINKPATH)" -Wl,-R$(SPACE)-Wl,"$(RPATH)" -o "$(<)" -Wl,-soname$(SPACE)-Wl,$(<[1]:D=) -shared "$(>)" "$(LIBRARIES)" -l$(FINDLIBS-SA) -l$(FINDLIBS-ST) $(OPTIONS) $(USER_OPTIONS)
+}
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/fop.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/fop.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -6,100 +6,64 @@
# This module defines rules to handle generation of PDF and
# PostScript files from XSL Formatting Objects via Apache FOP
-import os ;
import generators ;
import common ;
-import errors ;
import boostbook ;
generators.register-standard fop.render.pdf : FO : PDF ;
generators.register-standard fop.render.ps : FO : PS ;
+# Initializes the fop toolset.
+#
rule init ( fop-command ? : java-home ? : java ? )
{
- fop-command = [ common.get-invocation-command fop : fop : $(fop-command)
- : [ modules.peek : FOP_DIR ] ] ;
-
- .FOP_COMMAND = $(fop-command) ;
- .FOP_SETUP = ;
-
- # JAVA_HOME is the location that java was installed to.
-
- if $(java-home)
+ local has-command = $(.has-command) ;
+
+ if $(fop-command)
{
- .FOP_SETUP += [ common.variable-setting-command JAVA_HOME : $(java-home) ] ;
+ .has-command = true ;
}
- # JAVACMD is the location that of the java executable, useful for a
- # non-standard java installation, where the executable isn't at
- # $JAVA_HOME/bin/java.
-
- if $(java)
+ if $(fop-command) || ! $(has-command)
{
- .FOP_SETUP += [ common.variable-setting-command JAVACMD : $(java) ] ;
+ fop-command = [ common.get-invocation-command fop : fop : $(fop-command)
+ : [ modules.peek : FOP_DIR ] ] ;
}
- # Make sure the fop command is executed from within the directory where it's located.
-
- # DPG: I can't see how this could ever be correct, because it
- # messes up path names that are used in the command.
+ if $(fop-command)
+ {
+ .FOP_COMMAND = $(fop-command) ;
+ }
- # if $(.FOP_COMMAND:D)
- # {
- # .FOP_SETUP = $(.FOP_SETUP)"
-# cd "$(.FOP_COMMAND:D) ;
- # }
-
-}
+ if $(java-home) || $(java)
+ {
+ .FOP_SETUP = ;
-local rule find-by-absolute-path ( target )
-{
- # Mask off any vars by these names that may be hanging around in
- # outer dynamic scopes.
- local LOCATE SEARCH ;
- # simulate the target binding process to find the target
+ # JAVA_HOME is the location that java was installed to.
- local found = [ on $(target) GLOB $(LOCATE) (SEARCH) : $(target:G=) ] ;
+ if $(java-home)
+ {
+ .FOP_SETUP += [ common.variable-setting-command JAVA_HOME : $(java-home) ] ;
+ }
+
+ # JAVACMD is the location that of the java executable, useful for a
+ # non-standard java installation, where the executable isn't at
+ # $JAVA_HOME/bin/java.
- if $(found)
- {
- # Re-LOCATE the target with an absolute path if it isn't
- # already absolute.
- local found-dir = $(found[1]:D) ;
- local cwd = [ PWD ] ;
- local absolute-dir = $(found-dir:R=$(cwd)) ;
-
- # Translate cygwin paths to Windows iff the user is running on
- # cygwin but using a Windows FOP. We detect a Windows FOP by
- # looking to see if FOP_COMMAND ends with ".bat"
- if [ os.name ] = CYGWIN && [ MATCH .*\\.([Bb][Aa][Tt])$ : $(.FOP_COMMAND) ]
+ if $(java)
{
- absolute-dir = "`cygpath --windows '$(absolute-dir)'`" ;
+ .FOP_SETUP += [ common.variable-setting-command JAVACMD : $(java) ] ;
}
- LOCATE on $(target) = $(absolute-dir) ;
}
}
-rule render.pdf ( source : target : properties * )
-{
- find-by-absolute-path $(source) ;
- find-by-absolute-path $(target) ;
-}
-
-rule render.ps ( source : target : properties * )
-{
- find-by-absolute-path $(source) ;
- find-by-absolute-path $(target) ;
-}
-
-
actions render.pdf
{
- $(.FOP_SETUP) $(.FOP_COMMAND) $(>) $(<)
+ $(.FOP_SETUP) $(.FOP_COMMAND:E=fop) $(>) $(<)
}
actions render.ps
{
- $(.FOP_SETUP) $(.FOP_COMMAND) $(>) -ps $(<)
+ $(.FOP_SETUP) $(.FOP_COMMAND:E=fop) $(>) -ps $(<)
}
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/gcc.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/gcc.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -284,6 +284,8 @@
JAMSHELL = % ;
}
+generators.register-c-compiler gcc.compile.c++.preprocess : CPP : PREPROCESSED_CPP : <toolset>gcc ;
+generators.register-c-compiler gcc.compile.c.preprocess : C : PREPROCESSED_C : <toolset>gcc ;
generators.register-c-compiler gcc.compile.c++ : CPP : OBJ : <toolset>gcc ;
generators.register-c-compiler gcc.compile.c : C : OBJ : <toolset>gcc ;
generators.register-c-compiler gcc.compile.asm : ASM : OBJ : <toolset>gcc ;
@@ -507,6 +509,37 @@
"$(CONFIG_COMMAND)" -x c-header $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
+rule compile.c++.preprocess ( targets * : sources * : properties * )
+{
+ setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
+
+ # Some extensions are compiled as C++ by default. For others, we need to
+ # pass -x c++. We could always pass -x c++ but distcc does not work with it.
+ if ! $(>:S) in .cc .cp .cxx .cpp .c++ .C
+ {
+ LANG on $(<) = "-x c++" ;
+ }
+ DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
+}
+
+rule compile.c.preprocess ( targets * : sources * : properties * )
+{
+ setup-threading $(targets) : $(sources) : $(properties) ;
+ setup-fpic $(targets) : $(sources) : $(properties) ;
+ setup-address-model $(targets) : $(sources) : $(properties) ;
+
+ # If we use the name g++ then default file suffix -> language mapping does
+ # not work. So have to pass -x option. Maybe, we can work around this by
+ # allowing the user to specify both C and C++ compiler names.
+ #if $(>:S) != .c
+ #{
+ LANG on $(<) = "-x c" ;
+ #}
+ DEPENDS $(<) : [ on $(<) return $(PCH_FILE) ] ;
+}
+
rule compile.c++ ( targets * : sources * : properties * )
{
setup-threading $(targets) : $(sources) : $(properties) ;
@@ -570,6 +603,16 @@
"$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
}
+actions compile.c++.preprocess bind PCH_FILE
+{
+ "$(CONFIG_COMMAND)" $(LANG) -ftemplate-depth-$(TEMPLATE_DEPTH) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" "$(>:W)" -E >"$(<:W)"
+}
+
+actions compile.c.preprocess bind PCH_FILE
+{
+ "$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" "$(>)" -E >$(<)
+}
+
actions compile.fortran
{
"$(CONFIG_COMMAND)" $(LANG) $(OPTIONS) $(USER_OPTIONS) -D$(DEFINES) -I"$(PCH_FILE:D)" -I"$(INCLUDES)" -c -o "$(<)" "$(>)"
@@ -577,6 +620,7 @@
rule compile.asm ( targets * : sources * : properties * )
{
+ setup-fpic $(targets) : $(sources) : $(properties) ;
setup-address-model $(targets) : $(sources) : $(properties) ;
LANG on $(<) = "-x assembler-with-cpp" ;
}
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/intel-linux.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/intel-linux.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -224,7 +224,7 @@
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
- JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
+ JAM_SEMAPHORE on $(targets) = <s>intel-linux-link-semaphore ;
}
actions link bind LIBRARIES
@@ -237,7 +237,7 @@
gcc.setup-threading $(targets) : $(sources) : $(properties) ;
gcc.setup-address-model $(targets) : $(sources) : $(properties) ;
SPACE on $(targets) = " " ;
- JAM_SEMAPHORE on $(targets) = <s>gcc-link-semaphore ;
+ JAM_SEMAPHORE on $(targets) = <s>intel-linux-link-semaphore ;
}
# Differ from 'link' above only by -shared.
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/mpi.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/mpi.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -64,6 +64,7 @@
import testing ;
import toolset ;
import type ;
+import path ;
# Make this module a project
project.initialize $(__name__) ;
==============================================================================
--- branches/quickbook-dev/tools/build/v2/tools/msvc.jam (original)
+++ branches/quickbook-dev/tools/build/v2/tools/msvc.jam 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -325,6 +325,14 @@
}
+rule compile.c.preprocess ( targets + : sources * : properties * )
+{
+ C++FLAGS on $(targets[1]) = ;
+ get-rspline $(targets) : -TC ;
+ preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
+}
+
+
rule compile.c.pch ( targets + : sources * : properties * )
{
C++FLAGS on $(targets[1]) = ;
@@ -363,6 +371,11 @@
$(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -Fo"$(<[1]:W)" $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" $(.CC.FILTER)
}
+actions preprocess-c-c++ bind PDB_NAME
+{
+ $(.CC) @"@($(<[1]:W).rsp:E="$(>[1]:W)" -E $(PDB_CFLAG)"$(PDB_NAME)" -Yu"$(>[3]:D=)" -Fp"$(>[2]:W)" $(CC_RSPLINE))" >"$(<[1]:W)"
+}
+
rule compile-c-c++ ( targets + : sources * )
{
DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
@@ -370,6 +383,13 @@
PDB_NAME on $(<) = $(<:S=.pdb) ;
}
+rule preprocess-c-c++ ( targets + : sources * )
+{
+ DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_HEADER) ] ;
+ DEPENDS $(<[1]) : [ on $(<[1]) return $(PCH_FILE) ] ;
+ PDB_NAME on $(<) = $(<:S=.pdb) ;
+}
+
# Action for running the C/C++ compiler using precompiled headers. In addition
# to whatever else it needs to compile, this action also adds a temporary source
# .cpp file used to compile the precompiled headers themselves.
@@ -397,6 +417,12 @@
compile-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
}
+rule compile.c++.preprocess ( targets + : sources * : properties * )
+{
+ get-rspline $(targets) : -TP ;
+ preprocess-c-c++ $(<) : $(>) [ on $(<) return $(PCH_FILE) ] [ on $(<) return $(PCH_HEADER) ] ;
+}
+
rule compile.c++.pch ( targets + : sources * : properties * )
{
@@ -1110,6 +1136,8 @@
generators.register-archiver msvc.archive : OBJ : STATIC_LIB : <toolset>msvc ;
generators.register-c-compiler msvc.compile.c++ : CPP : OBJ : <toolset>msvc ;
generators.register-c-compiler msvc.compile.c : C : OBJ : <toolset>msvc ;
+ generators.register-c-compiler msvc.compile.c++.preprocess : CPP : PREPROCESSED_CPP : <toolset>msvc ;
+ generators.register-c-compiler msvc.compile.c.preprocess : C : PREPROCESSED_C : <toolset>msvc ;
# Using 'register-c-compiler' adds the build directory to INCLUDES.
generators.register-c-compiler msvc.compile.rc : RC : OBJ(%_res) : <toolset>msvc ;
==============================================================================
--- branches/quickbook-dev/tools/quickbook/doc/change_log.qbk (original)
+++ branches/quickbook-dev/tools/quickbook/doc/change_log.qbk 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -239,6 +239,7 @@
* Use relative paths for `__FILENAME__` macro.
* Rewrite xinclude path generator so that it doesn't use deprecated
filesystem functions.
+* Allow quickbook escapes inside comments in syntax highlighted code.
* Quickbook 1.6:
* Scope source mode changes to the file they're made in.
* Explicit markup for lists. e.g.
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/src/Jamfile.v2 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -14,7 +14,6 @@
<toolset>darwin:<c++-template-depth>300
<toolset>gcc:<cflags>-g0
<toolset>darwin:<cflags>-g0
- <warnings>all
<toolset>msvc:<cflags>/wd4709
;
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -59,7 +59,7 @@
{
tgt << "<anchor id=\"";
detail::print_string(*it, tgt.get());
- tgt << "\"/>\n";
+ tgt << "\"/>";
}
actions.anchors.clear();
@@ -190,9 +190,8 @@
if(!actions.warned_about_breaks)
{
detail::outwarn(actions.filename, pos.line)
- << "line breaks generate invalid boostbook"
- << " (will only note first occurrence)."
- << "\n";
+ << "line breaks generate invalid boostbook "
+ "(will only note first occurrence).\n";
actions.warned_about_breaks = true;
}
@@ -368,14 +367,7 @@
values.finish();
out << markup.pre;
- if (std::string const* ptr = find(macro, content.get_quickbook().c_str()))
- {
- out << *ptr;
- }
- else
- {
- out << content.get_boostbook();
- }
+ out << content.get_boostbook();
out << markup.post;
}
@@ -523,12 +515,26 @@
}
// TODO: No need to check suppress since this is only used in the syntax
- // highlighter. I should moved this or something.
+ // highlighter. I should move this or something.
void span::operator()(iterator first, iterator last) const
{
+ if (name) out << "<phrase role=\"" << name << "\">";
+ while (first != last)
+ detail::print_char(*first++, out.get());
+ if (name) out << "</phrase>";
+ }
+
+ void span_start::operator()(iterator first, iterator last) const
+ {
out << "<phrase role=\"" << name << "\">";
while (first != last)
detail::print_char(*first++, out.get());
+ }
+
+ void span_end::operator()(iterator first, iterator last) const
+ {
+ while (first != last)
+ detail::print_char(*first++, out.get());
out << "</phrase>";
}
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions.hpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions.hpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -124,16 +124,13 @@
simple_phrase_action(
collector& out
- , string_symbols const& macro
, quickbook::actions& actions)
: out(out)
- , macro(macro)
, actions(actions) {}
void operator()(char) const;
collector& out;
- string_symbols const& macro;
quickbook::actions& actions;
};
@@ -163,6 +160,27 @@
collector& out;
};
+ struct span_start
+ {
+ span_start(char const* name, collector& out)
+ : name(name), out(out) {}
+
+ void operator()(iterator first, iterator last) const;
+
+ char const* name;
+ collector& out;
+ };
+
+ struct span_end
+ {
+ span_end(collector& out)
+ : out(out) {}
+
+ void operator()(iterator first, iterator last) const;
+
+ collector& out;
+ };
+
struct unexpected_char
{
// Handles unexpected chars in c++ syntax
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/actions_class.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/actions_class.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -71,7 +71,7 @@
, raw_char(phrase, *this)
, escape_unicode(phrase, *this)
- , simple_markup(phrase, macro, *this)
+ , simple_markup(phrase, *this)
, break_(phrase, *this)
, do_macro(phrase, *this)
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/main_grammar.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -89,7 +89,7 @@
top_level, blocks, paragraph_separator,
code, code_line, blank_line, hr,
list, list_item,
- nested_char, escape,
+ escape,
inline_code,
template_,
code_block, macro,
@@ -369,10 +369,10 @@
;
local.simple_markup =
- cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
- >> cl::eps_p(cl::graph_p) // graph_p must follow first mark
+ cl::chset<>("*/_=") [local.simple_markup.mark = ph::arg1]
+ >> cl::eps_p(cl::graph_p) // graph_p must follow first mark
>> lookback
- [ cl::anychar_p
+ [ cl::anychar_p // skip back over the markup
>> ~cl::eps_p(cl::f_ch_p(local.simple_markup.mark))
// first mark not be preceeded by
// the same character.
@@ -385,11 +385,18 @@
[
actions.scoped_output()
[
- (+( ~cl::eps_p(local.simple_markup_end)
- >> local.nested_char
- )) [actions.docinfo_value(ph::arg1, ph::arg2)]
- ]
- >> cl::f_ch_p(local.simple_markup.mark)
+ ( cl::eps_p(actions.macro >> local.simple_markup_end)
+ >> actions.macro [actions.do_macro]
+ | ~cl::eps_p(cl::f_ch_p(local.simple_markup.mark))
+ >> +( ~cl::eps_p
+ ( lookback [~cl::f_ch_p(local.simple_markup.mark)]
+ >> local.simple_markup_end
+ )
+ >> cl::anychar_p [actions.plain_char]
+ )
+ ) [actions.to_value]
+ ]
+ >> cl::f_ch_p(local.simple_markup.mark)
[actions.simple_markup]
]
;
@@ -448,19 +455,6 @@
]
;
- local.nested_char =
- cl::str_p("\\n") [actions.break_]
- | "\\ " // ignore an escaped space
- | '\\' >> cl::punct_p [actions.raw_char]
- | "\\u" >> cl::repeat_p(4)
- [cl::chset<>("0-9a-fA-F")]
- [actions.escape_unicode]
- | "\\U" >> cl::repeat_p(8)
- [cl::chset<>("0-9a-fA-F")]
- [actions.escape_unicode]
- | cl::anychar_p [actions.plain_char]
- ;
-
local.escape =
cl::str_p("\\n") [actions.break_]
| cl::str_p("\\ ") // ignore an escaped space
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/syntax_highlight.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/src/syntax_highlight.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -7,42 +7,394 @@
License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-#include "syntax_highlight.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_loops.hpp>
+#include "grammar.hpp"
+#include "grammar_impl.hpp" // Just for context stuff. Should move?
#include "actions_class.hpp"
namespace quickbook
-{
- typedef cpp_highlight<
- span
- , space
- , string_symbols
- , do_macro_action
- , pre_escape_back
- , post_escape_back
- , unexpected_char
- , collector>
- cpp_p_type;
-
- typedef python_highlight<
- span
- , space
- , string_symbols
- , do_macro_action
- , pre_escape_back
- , post_escape_back
- , unexpected_char
- , collector>
- python_p_type;
-
- typedef teletype_highlight<
- plain_char_action
- , string_symbols
- , do_macro_action
- , pre_escape_back
- , post_escape_back
- , collector>
- teletype_p_type;
-
+{
+ namespace cl = boost::spirit::classic;
+
+ // Grammar for C++ highlighting
+ struct cpp_highlight
+ : public cl::grammar<cpp_highlight>
+ {
+ cpp_highlight(collector& out, actions& escape_actions)
+ : out(out), escape_actions(escape_actions) {}
+
+ template <typename Scanner>
+ struct definition
+ {
+ definition(cpp_highlight const& self)
+ : g(self.escape_actions.grammar())
+ {
+ program
+ =
+ *( (+cl::space_p) [space(self.out)]
+ | macro
+ | escape
+ | preprocessor [span("preprocessor", self.out)]
+ | comment
+ | keyword [span("keyword", self.out)]
+ | identifier [span("identifier", self.out)]
+ | special [span("special", self.out)]
+ | string_ [span("string", self.out)]
+ | char_ [span("char", self.out)]
+ | number [span("number", self.out)]
+ | cl::repeat_p(1)[cl::anychar_p]
+ [unexpected_char(self.out, self.escape_actions)]
+ )
+ ;
+
+ macro =
+ // must not be followed by alpha or underscore
+ cl::eps_p(self.escape_actions.macro
+ >> (cl::eps_p - (cl::alpha_p | '_')))
+ >> self.escape_actions.macro [do_macro_action(self.out, self.escape_actions)]
+ ;
+
+ qbk_phrase =
+ self.escape_actions.scoped_context(element_info::in_phrase)
+ [ *( g.common
+ | (cl::anychar_p - cl::str_p("``"))
+ [self.escape_actions.plain_char]
+ )
+ ]
+ ;
+
+ escape =
+ cl::str_p("``") [pre_escape_back(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(cl::anychar_p - "``") >> cl::eps_p("``"))
+ & qbk_phrase
+ )
+ >> cl::str_p("``")
+ )
+ |
+ (
+ cl::eps_p [self.escape_actions.error]
+ >> *cl::anychar_p
+ )
+ ) [post_escape_back(self.out, self.escape_actions, save)]
+ ;
+
+ preprocessor
+ = '#' >> *cl::space_p >> ((cl::alpha_p | '_') >> *(cl::alnum_p | '_'))
+ ;
+
+ comment
+ = cl::str_p("//") [span_start("comment", self.out)]
+ >> *( escape
+ | (+(cl::anychar_p - (cl::eol_p | "``")))
+ [span(0, self.out)]
+ )
+ >> cl::eps_p [span_end(self.out)]
+ | cl::str_p("/*") [span_start("comment", self.out)]
+ >> *( escape
+ | (+(cl::anychar_p - (cl::str_p("*/") | "``")))
+ [span(0, self.out)]
+ )
+ >> (!cl::str_p("*/")) [span_end(self.out)]
+ ;
+
+ keyword
+ = keyword_ >> (cl::eps_p - (cl::alnum_p | '_'))
+ ; // make sure we recognize whole words only
+
+ keyword_
+ = "and_eq", "and", "asm", "auto", "bitand", "bitor",
+ "bool", "break", "case", "catch", "char", "class",
+ "compl", "const_cast", "const", "continue", "default",
+ "delete", "do", "double", "dynamic_cast", "else",
+ "enum", "explicit", "export", "extern", "false",
+ "float", "for", "friend", "goto", "if", "inline",
+ "int", "long", "mutable", "namespace", "new", "not_eq",
+ "not", "operator", "or_eq", "or", "private",
+ "protected", "public", "register", "reinterpret_cast",
+ "return", "short", "signed", "sizeof", "static",
+ "static_cast", "struct", "switch", "template", "this",
+ "throw", "true", "try", "typedef", "typeid",
+ "typename", "union", "unsigned", "using", "virtual",
+ "void", "volatile", "wchar_t", "while", "xor_eq", "xor"
+ ;
+
+ special
+ = +cl::chset_p("~!%^&*()+={[}]:;,<.>?/|\\-")
+ ;
+
+ string_char = ('\\' >> cl::anychar_p) | (cl::anychar_p - '\\');
+
+ string_
+ = !cl::as_lower_d['l'] >> cl::confix_p('"', *string_char, '"')
+ ;
+
+ char_
+ = !cl::as_lower_d['l'] >> cl::confix_p('\'', *string_char, '\'')
+ ;
+
+ number
+ = (
+ cl::as_lower_d["0x"] >> cl::hex_p
+ | '0' >> cl::oct_p
+ | cl::real_p
+ )
+ >> *cl::as_lower_d[cl::chset_p("ldfu")]
+ ;
+
+ identifier
+ = (cl::alpha_p | '_') >> *(cl::alnum_p | '_')
+ ;
+ }
+
+ cl::rule<Scanner>
+ program, macro, preprocessor, comment, special, string_,
+ char_, number, identifier, keyword, qbk_phrase, escape,
+ string_char;
+
+ cl::symbols<> keyword_;
+ quickbook_grammar& g;
+ std::string save;
+
+ cl::rule<Scanner> const&
+ start() const { return program; }
+ };
+
+ collector& out;
+ actions& escape_actions;
+ };
+
+ // Grammar for Python highlighting
+ // See also: The Python Reference Manual
+ // http://docs.python.org/ref/ref.html
+ struct python_highlight
+ : public cl::grammar<python_highlight>
+ {
+ python_highlight(collector& out, actions& escape_actions)
+ : out(out), escape_actions(escape_actions) {}
+
+ template <typename Scanner>
+ struct definition
+ {
+ definition(python_highlight const& self)
+ : g(self.escape_actions.grammar())
+ {
+ program
+ =
+ *( (+cl::space_p) [space(self.out)]
+ | macro
+ | escape
+ | comment
+ | keyword [span("keyword", self.out)]
+ | identifier [span("identifier", self.out)]
+ | special [span("special", self.out)]
+ | string_ [span("string", self.out)]
+ | number [span("number", self.out)]
+ | cl::repeat_p(1)[cl::anychar_p]
+ [unexpected_char(self.out, self.escape_actions)]
+ )
+ ;
+
+ macro =
+ // must not be followed by alpha or underscore
+ cl::eps_p(self.escape_actions.macro
+ >> (cl::eps_p - (cl::alpha_p | '_')))
+ >> self.escape_actions.macro [do_macro_action(self.out, self.escape_actions)]
+ ;
+
+ qbk_phrase =
+ self.escape_actions.scoped_context(element_info::in_phrase)
+ [
+ *( g.common
+ | (cl::anychar_p - cl::str_p("``"))
+ [self.escape_actions.plain_char]
+ )
+ ]
+ ;
+
+ escape =
+ cl::str_p("``") [pre_escape_back(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(cl::anychar_p - "``") >> cl::eps_p("``"))
+ & qbk_phrase
+ )
+ >> cl::str_p("``")
+ )
+ |
+ (
+ cl::eps_p [self.escape_actions.error]
+ >> *cl::anychar_p
+ )
+ ) [post_escape_back(self.out, self.escape_actions, save)]
+ ;
+
+ comment
+ = cl::str_p("#") [span_start("comment", self.out)]
+ >> *( escape
+ | (+(cl::anychar_p - (cl::eol_p | "``")))
+ [span(0, self.out)]
+ )
+ >> cl::eps_p [span_end(self.out)]
+ ;
+
+ keyword
+ = keyword_ >> (cl::eps_p - (cl::alnum_p | '_'))
+ ; // make sure we recognize whole words only
+
+ keyword_
+ =
+ "and", "del", "for", "is", "raise",
+ "assert", "elif", "from", "lambda", "return",
+ "break", "else", "global", "not", "try",
+ "class", "except", "if", "or", "while",
+ "continue", "exec", "import", "pass", "yield",
+ "def", "finally", "in", "print",
+
+ // Technically "as" and "None" are not yet keywords (at Python
+ // 2.4). They are destined to become keywords, and we treat them
+ // as such for syntax highlighting purposes.
+
+ "as", "None"
+ ;
+
+ special
+ = +cl::chset_p("~!%^&*()+={[}]:;,<.>/|\\-")
+ ;
+
+ string_prefix
+ = cl::as_lower_d[cl::str_p("u") >> ! cl::str_p("r")]
+ ;
+
+ string_
+ = ! string_prefix >> (long_string | short_string)
+ ;
+
+ string_char = ('\\' >> cl::anychar_p) | (cl::anychar_p - '\\');
+
+ short_string
+ = cl::confix_p('\'', * string_char, '\'') |
+ cl::confix_p('"', * string_char, '"')
+ ;
+
+ long_string
+ // Note: the "cl::str_p" on the next two lines work around
+ // an INTERNAL COMPILER ERROR when using VC7.1
+ = cl::confix_p(cl::str_p("'''"), * string_char, "'''") |
+ cl::confix_p(cl::str_p("\"\"\""), * string_char, "\"\"\"")
+ ;
+
+ number
+ = (
+ cl::as_lower_d["0x"] >> cl::hex_p
+ | '0' >> cl::oct_p
+ | cl::real_p
+ )
+ >> *cl::as_lower_d[cl::chset_p("lj")]
+ ;
+
+ identifier
+ = (cl::alpha_p | '_') >> *(cl::alnum_p | '_')
+ ;
+ }
+
+ cl::rule<Scanner>
+ program, macro, comment, special, string_, string_prefix,
+ short_string, long_string, number, identifier, keyword,
+ qbk_phrase, escape, string_char;
+
+ cl::symbols<> keyword_;
+ quickbook_grammar& g;
+ std::string save;
+
+ cl::rule<Scanner> const&
+ start() const { return program; }
+ };
+
+ collector& out;
+ actions& escape_actions;
+ };
+
+ // Grammar for plain text (no actual highlighting)
+ struct teletype_highlight
+ : public cl::grammar<teletype_highlight>
+ {
+ teletype_highlight(collector& out, actions& escape_actions)
+ : out(out), escape_actions(escape_actions) {}
+
+ template <typename Scanner>
+ struct definition
+ {
+ definition(teletype_highlight const& self)
+ : g(self.escape_actions.grammar())
+ {
+ program
+ =
+ *( macro
+ | escape
+ | cl::repeat_p(1)[cl::anychar_p] [plain_char_action(self.out, self.escape_actions)]
+ )
+ ;
+
+ macro =
+ // must not be followed by alpha or underscore
+ cl::eps_p(self.escape_actions.macro
+ >> (cl::eps_p - (cl::alpha_p | '_')))
+ >> self.escape_actions.macro [do_macro_action(self.out, self.escape_actions)]
+ ;
+
+ qbk_phrase =
+ self.escape_actions.scoped_context(element_info::in_phrase)
+ [
+ *( g.common
+ | (cl::anychar_p - cl::str_p("``"))
+ [self.escape_actions.plain_char]
+ )
+ ]
+ ;
+
+ escape =
+ cl::str_p("``") [pre_escape_back(self.escape_actions, save)]
+ >>
+ (
+ (
+ (
+ (+(cl::anychar_p - "``") >> cl::eps_p("``"))
+ & qbk_phrase
+ )
+ >> cl::str_p("``")
+ )
+ |
+ (
+ cl::eps_p [self.escape_actions.error]
+ >> *cl::anychar_p
+ )
+ ) [post_escape_back(self.out, self.escape_actions, save)]
+ ;
+ }
+
+ cl::rule<Scanner> program, macro, qbk_phrase, escape;
+
+ quickbook_grammar& g;
+ std::string save;
+
+ cl::rule<Scanner> const&
+ start() const { return program; }
+ };
+
+ collector& out;
+ actions& escape_actions;
+ };
+
std::string syntax_highlight(
iterator first, iterator last,
actions& escape_actions,
@@ -53,17 +405,17 @@
// print the code with syntax coloring
if (source_mode == "c++")
{
- cpp_p_type cpp_p(temp, escape_actions.macro, do_macro_action(temp, escape_actions), escape_actions);
+ cpp_highlight cpp_p(temp, escape_actions);
boost::spirit::classic::parse(first, last, cpp_p);
}
else if (source_mode == "python")
{
- python_p_type python_p(temp, escape_actions.macro, do_macro_action(temp, escape_actions), escape_actions);
+ python_highlight python_p(temp, escape_actions);
boost::spirit::classic::parse(first, last, python_p);
}
else if (source_mode == "teletype")
{
- teletype_p_type teletype_p(temp, escape_actions.macro, do_macro_action(temp, escape_actions), escape_actions);
+ teletype_highlight teletype_p(temp, escape_actions);
boost::spirit::classic::parse(first, last, teletype_p);
}
else
==============================================================================
--- branches/quickbook-dev/tools/quickbook/src/syntax_highlight.hpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
+++ (empty file)
@@ -1,417 +0,0 @@
-/*=============================================================================
- Copyright (c) 2002 2004 2006 Joel de Guzman
- Copyright (c) 2004 Eric Niebler
- 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_SYNTAX_HIGHLIGHT_HPP)
-#define BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_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_loops.hpp>
-#include "grammar.hpp"
-#include "grammar_impl.hpp" // Just for context stuff. Should move?
-
-namespace quickbook
-{
- namespace cl = boost::spirit::classic;
-
- // Grammar for C++ highlighting
- template <
- typename Process
- , typename Space
- , typename Macro
- , typename DoMacro
- , typename PreEscape
- , typename PostEscape
- , typename Unexpected
- , typename Out>
- struct cpp_highlight
- : public cl::grammar<cpp_highlight<Process, Space, Macro, DoMacro, PreEscape, PostEscape, Unexpected, Out> >
- {
- cpp_highlight(Out& out, Macro const& macro, DoMacro do_macro, actions& escape_actions)
- : out(out), macro(macro), do_macro(do_macro), escape_actions(escape_actions) {}
-
- template <typename Scanner>
- struct definition
- {
- definition(cpp_highlight const& self)
- : g(self.escape_actions.grammar())
- {
- program
- =
- *( (+cl::space_p) [Space(self.out)]
- | macro
- | escape
- | preprocessor [Process("preprocessor", self.out)]
- | comment [Process("comment", self.out)]
- | keyword [Process("keyword", self.out)]
- | identifier [Process("identifier", self.out)]
- | special [Process("special", self.out)]
- | string_ [Process("string", self.out)]
- | char_ [Process("char", self.out)]
- | number [Process("number", self.out)]
- | cl::repeat_p(1)[cl::anychar_p]
- [Unexpected(self.out, self.escape_actions)]
- )
- ;
-
- macro =
- // must not be followed by alpha or underscore
- cl::eps_p(self.macro
- >> (cl::eps_p - (cl::alpha_p | '_')))
- >> self.macro [self.do_macro]
- ;
-
- qbk_phrase =
- self.escape_actions.scoped_context(element_info::in_phrase)
- [ *( g.common
- | (cl::anychar_p - cl::str_p("``"))
- [self.escape_actions.plain_char]
- )
- ]
- ;
-
- escape =
- cl::str_p("``") [PreEscape(self.escape_actions, save)]
- >>
- (
- (
- (
- (+(cl::anychar_p - "``") >> cl::eps_p("``"))
- & qbk_phrase
- )
- >> cl::str_p("``")
- )
- |
- (
- cl::eps_p [self.escape_actions.error]
- >> *cl::anychar_p
- )
- ) [PostEscape(self.out, self.escape_actions, save)]
- ;
-
- preprocessor
- = '#' >> *cl::space_p >> ((cl::alpha_p | '_') >> *(cl::alnum_p | '_'))
- ;
-
- comment
- = cl::comment_p("//") | cl::comment_p("/*", "*/")
- ;
-
- keyword
- = keyword_ >> (cl::eps_p - (cl::alnum_p | '_'))
- ; // make sure we recognize whole words only
-
- keyword_
- = "and_eq", "and", "asm", "auto", "bitand", "bitor",
- "bool", "break", "case", "catch", "char", "class",
- "compl", "const_cast", "const", "continue", "default",
- "delete", "do", "double", "dynamic_cast", "else",
- "enum", "explicit", "export", "extern", "false",
- "float", "for", "friend", "goto", "if", "inline",
- "int", "long", "mutable", "namespace", "new", "not_eq",
- "not", "operator", "or_eq", "or", "private",
- "protected", "public", "register", "reinterpret_cast",
- "return", "short", "signed", "sizeof", "static",
- "static_cast", "struct", "switch", "template", "this",
- "throw", "true", "try", "typedef", "typeid",
- "typename", "union", "unsigned", "using", "virtual",
- "void", "volatile", "wchar_t", "while", "xor_eq", "xor"
- ;
-
- special
- = +cl::chset_p("~!%^&*()+={[}]:;,<.>?/|\\-")
- ;
-
- string_char = ('\\' >> cl::anychar_p) | (cl::anychar_p - '\\');
-
- string_
- = !cl::as_lower_d['l'] >> cl::confix_p('"', *string_char, '"')
- ;
-
- char_
- = !cl::as_lower_d['l'] >> cl::confix_p('\'', *string_char, '\'')
- ;
-
- number
- = (
- cl::as_lower_d["0x"] >> cl::hex_p
- | '0' >> cl::oct_p
- | cl::real_p
- )
- >> *cl::as_lower_d[cl::chset_p("ldfu")]
- ;
-
- identifier
- = (cl::alpha_p | '_') >> *(cl::alnum_p | '_')
- ;
- }
-
- cl::rule<Scanner>
- program, macro, preprocessor, comment, special, string_,
- char_, number, identifier, keyword, qbk_phrase, escape,
- string_char;
-
- cl::symbols<> keyword_;
- quickbook_grammar& g;
- std::string save;
-
- cl::rule<Scanner> const&
- start() const { return program; }
- };
-
- Out& out;
- Macro const& macro;
- DoMacro do_macro;
- actions& escape_actions;
- };
-
- // Grammar for Python highlighting
- // See also: The Python Reference Manual
- // http://docs.python.org/ref/ref.html
- template <
- typename Process
- , typename Space
- , typename Macro
- , typename DoMacro
- , typename PreEscape
- , typename PostEscape
- , typename Unexpected
- , typename Out>
- struct python_highlight
- : public cl::grammar<python_highlight<Process, Space, Macro, DoMacro, PreEscape, PostEscape, Unexpected, Out> >
- {
- python_highlight(Out& out, Macro const& macro, DoMacro do_macro, actions& escape_actions)
- : out(out), macro(macro), do_macro(do_macro), escape_actions(escape_actions) {}
-
- template <typename Scanner>
- struct definition
- {
- definition(python_highlight const& self)
- : g(self.escape_actions.grammar())
- {
- program
- =
- *( (+cl::space_p) [Space(self.out)]
- | macro
- | escape
- | comment [Process("comment", self.out)]
- | keyword [Process("keyword", self.out)]
- | identifier [Process("identifier", self.out)]
- | special [Process("special", self.out)]
- | string_ [Process("string", self.out)]
- | number [Process("number", self.out)]
- | cl::repeat_p(1)[cl::anychar_p]
- [Unexpected(self.out, self.escape_actions)]
- )
- ;
-
- macro =
- // must not be followed by alpha or underscore
- cl::eps_p(self.macro
- >> (cl::eps_p - (cl::alpha_p | '_')))
- >> self.macro [self.do_macro]
- ;
-
- qbk_phrase =
- self.escape_actions.scoped_context(element_info::in_phrase)
- [
- *( g.common
- | (cl::anychar_p - cl::str_p("``"))
- [self.escape_actions.plain_char]
- )
- ]
- ;
-
- escape =
- cl::str_p("``") [PreEscape(self.escape_actions, save)]
- >>
- (
- (
- (
- (+(cl::anychar_p - "``") >> cl::eps_p("``"))
- & qbk_phrase
- )
- >> cl::str_p("``")
- )
- |
- (
- cl::eps_p [self.escape_actions.error]
- >> *cl::anychar_p
- )
- ) [PostEscape(self.out, self.escape_actions, save)]
- ;
-
- comment
- = cl::comment_p("#")
- ;
-
- keyword
- = keyword_ >> (cl::eps_p - (cl::alnum_p | '_'))
- ; // make sure we recognize whole words only
-
- keyword_
- =
- "and", "del", "for", "is", "raise",
- "assert", "elif", "from", "lambda", "return",
- "break", "else", "global", "not", "try",
- "class", "except", "if", "or", "while",
- "continue", "exec", "import", "pass", "yield",
- "def", "finally", "in", "print",
-
- // Technically "as" and "None" are not yet keywords (at Python
- // 2.4). They are destined to become keywords, and we treat them
- // as such for syntax highlighting purposes.
-
- "as", "None"
- ;
-
- special
- = +cl::chset_p("~!%^&*()+={[}]:;,<.>/|\\-")
- ;
-
- string_prefix
- = cl::as_lower_d[cl::str_p("u") >> ! cl::str_p("r")]
- ;
-
- string_
- = ! string_prefix >> (long_string | short_string)
- ;
-
- string_char = ('\\' >> cl::anychar_p) | (cl::anychar_p - '\\');
-
- short_string
- = cl::confix_p('\'', * string_char, '\'') |
- cl::confix_p('"', * string_char, '"')
- ;
-
- long_string
- // Note: the "cl::str_p" on the next two lines work around
- // an INTERNAL COMPILER ERROR when using VC7.1
- = cl::confix_p(cl::str_p("'''"), * string_char, "'''") |
- cl::confix_p(cl::str_p("\"\"\""), * string_char, "\"\"\"")
- ;
-
- number
- = (
- cl::as_lower_d["0x"] >> cl::hex_p
- | '0' >> cl::oct_p
- | cl::real_p
- )
- >> *cl::as_lower_d[cl::chset_p("lj")]
- ;
-
- identifier
- = (cl::alpha_p | '_') >> *(cl::alnum_p | '_')
- ;
- }
-
- cl::rule<Scanner>
- program, macro, comment, special, string_, string_prefix,
- short_string, long_string, number, identifier, keyword,
- qbk_phrase, escape, string_char;
-
- cl::symbols<> keyword_;
- quickbook_grammar& g;
- std::string save;
-
- cl::rule<Scanner> const&
- start() const { return program; }
- };
-
- Out& out;
- Macro const& macro;
- DoMacro do_macro;
- actions& escape_actions;
- };
-
- // Grammar for plain text (no actual highlighting)
- template <
- typename CharProcess
- , typename Macro
- , typename DoMacro
- , typename PreEscape
- , typename PostEscape
- , typename Out>
- struct teletype_highlight
- : public cl::grammar<teletype_highlight<CharProcess, Macro, DoMacro, PreEscape, PostEscape, Out> >
- {
- teletype_highlight(Out& out, Macro const& macro, DoMacro do_macro, actions& escape_actions)
- : out(out), macro(macro), do_macro(do_macro), escape_actions(escape_actions) {}
-
- template <typename Scanner>
- struct definition
- {
- definition(teletype_highlight const& self)
- : g(self.escape_actions.grammar())
- {
- program
- =
- *( macro
- | escape
- | cl::repeat_p(1)[cl::anychar_p] [CharProcess(self.out, self.escape_actions)]
- )
- ;
-
- macro =
- // must not be followed by alpha or underscore
- cl::eps_p(self.macro
- >> (cl::eps_p - (cl::alpha_p | '_')))
- >> self.macro [self.do_macro]
- ;
-
- qbk_phrase =
- self.escape_actions.scoped_context(element_info::in_phrase)
- [
- *( g.common
- | (cl::anychar_p - cl::str_p("``"))
- [self.escape_actions.plain_char]
- )
- ]
- ;
-
- escape =
- cl::str_p("``") [PreEscape(self.escape_actions, save)]
- >>
- (
- (
- (
- (+(cl::anychar_p - "``") >> cl::eps_p("``"))
- & qbk_phrase
- )
- >> cl::str_p("``")
- )
- |
- (
- cl::eps_p [self.escape_actions.error]
- >> *cl::anychar_p
- )
- ) [PostEscape(self.out, self.escape_actions, save)]
- ;
- }
-
- cl::rule<Scanner> program, macro, qbk_phrase, escape;
-
- quickbook_grammar& g;
- std::string save;
-
- cl::rule<Scanner> const&
- start() const { return program; }
- };
-
- Out& out;
- Macro const& macro;
- DoMacro do_macro;
- actions& escape_actions;
- };
-
-}
-
-#endif // BOOST_SPIRIT_QUICKBOOK_SYNTAX_HIGHLIGHT_HPP
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/Jamfile.v2 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -26,6 +26,8 @@
[ quickbook-test code-block-2 ]
[ quickbook-test code-block-3 ]
[ quickbook-test code-block-teletype ]
+ [ quickbook-test code-block-cpp ]
+ [ quickbook-test code-block-python ]
[ quickbook-test code-snippet ]
[ quickbook-test preformatted ]
[ quickbook-test link ]
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/anchor.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/anchor.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -6,42 +6,42 @@
<section id="anchor_test.anchors">
<title>Anchors</title>
<para>
- <anchor id="a1"/> A paragraph containing several anchors. <anchor id="a2"/>
- We want to make sure they appear in the correct place. <anchor id="a3"/>
+ <anchor id="a1"/>A paragraph containing several anchors. <anchor id="a2"/>We
+ want to make sure they appear in the correct place. <anchor id="a3"/>
</para>
<anchor id="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor"/>
<bridgehead renderas="sect3" id="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor-heading">
<link linkend="anchor_test.anchors.this_heading_shouldn_t_pick_up_the_previous_anchor">This
heading shouldn't pick up the previous anchor</link>
</bridgehead>
- <anchor id="a4"/> <anchor id="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor"/>
+ <anchor id="a4"/><anchor id="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor"/>
<bridgehead renderas="sect3" id="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor-heading">
<link linkend="anchor_test.anchors.this_heading_should_pick_up_the_previous_anchor">This
heading should pick up the previous anchor</link>
</bridgehead>
- <anchor id="a5"/> <anchor id="anchor_test.anchors.and_this_one"/>
+ <anchor id="a5"/><anchor id="anchor_test.anchors.and_this_one"/>
<bridgehead renderas="sect3" id="anchor_test.anchors.and_this_one-heading">
<link linkend="anchor_test.anchors.and_this_one">And this one</link>
</bridgehead>
- <anchor id="a6"/> <anchor id="anchor_test.anchors.also_this_one"/>
+ <anchor id="a6"/><anchor id="anchor_test.anchors.also_this_one"/>
<bridgehead renderas="sect3" id="anchor_test.anchors.also_this_one-heading">
<link linkend="anchor_test.anchors.also_this_one">Also this one</link>
</bridgehead>
- <anchor id="a7"/> <anchor id="anchors.finally_this"/>
+ <anchor id="a7"/><anchor id="anchors.finally_this"/>
<bridgehead renderas="sect3" id="anchors.finally_this-heading">
Finally this
</bridgehead>
<anchor id="a8"/>
</section>
<section id="anchor_test.section_anchor">
- <title><anchor id="a9"/> Section Anchor</title>
+ <title><anchor id="a9"/>Section Anchor</title>
<section id="anchor_test.nested_section">
- <title><anchor id="a10"/> Nested Section</title>
+ <title><anchor id="a10"/>Nested Section</title>
</section>
<anchor id="a11"/>
</section>
<section id="anchor_test.conditional_section_anchor">
- <title><anchor id="a12"/> Conditional Section Anchor</title>
+ <title><anchor id="a12"/>Conditional Section Anchor</title>
</section>
<section id="anchor_test.lists">
<title>Lists</title> <anchor id="a14"/>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/code-import.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/code-import.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -27,8 +27,8 @@
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
@@ -57,8 +57,8 @@
<para>
<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase>
- <phrase role="comment"># return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase>
+ <phrase role="comment"># return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase>
</programlisting>
</para>
@@ -87,8 +87,8 @@
<programlisting><phrase role="keyword">char</phrase><phrase role="special">*</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/code-include.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/code-include.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -40,19 +40,19 @@
<programlisting><phrase role="keyword">char</phrase><phrase role="special">*</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
<para>
-<programlisting><phrase role="comment"># Copyright 2009 Daniel James
-</phrase><phrase role="comment">#
-</phrase><phrase role="comment"># Use, modification and distribution is subject to the Boost Software
-</phrase><phrase role="comment"># License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-</phrase><phrase role="comment"># http://www.boost.org/LICENSE_1_0.txt)
-</phrase>
+<programlisting><phrase role="comment"># Copyright 2009 Daniel James</phrase>
+<phrase role="comment">#</phrase>
+<phrase role="comment"># Use, modification and distribution is subject to the Boost Software</phrase>
+<phrase role="comment"># License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at</phrase>
+<phrase role="comment"># http://www.boost.org/LICENSE_1_0.txt)</phrase>
+
</programlisting>
</para>
<para>
@@ -80,8 +80,8 @@
<para>
<programlisting><phrase role="keyword">def</phrase> <phrase role="identifier">foo</phrase><phrase role="special">():</phrase>
- <phrase role="comment"># return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase>
+ <phrase role="comment"># return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase>
<phrase role="keyword">print</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase></programlisting>
</para>
@@ -106,8 +106,8 @@
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">bar</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, bar man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, bar man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase></programlisting>
</para>
<para>
@@ -138,8 +138,8 @@
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
<phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo_bar</phrase><phrase role="special">()</phrase> <!--quickbook-escape-prefix--><co id="include0co" linkends="include0" /><!--quickbook-escape-postfix-->
<phrase role="special">{</phrase>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/macros-1.5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/macros-1.5.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -12,7 +12,7 @@
<itemizedlist>
<listitem>
<simpara>
- <emphasis role="underline">_foo_</emphasis>
+ __foo__
</simpara>
</listitem>
<listitem>
@@ -22,7 +22,7 @@
</listitem>
<listitem>
<simpara>
- <emphasis role="underline">_defined_macro_</emphasis>
+ __defined_macro__
</simpara>
</listitem>
<listitem>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/include/macros-1.6.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/include/macros-1.6.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -12,7 +12,7 @@
<itemizedlist>
<listitem>
<simpara>
- <emphasis role="underline">_foo_</emphasis>
+ __foo__
</simpara>
</listitem>
<listitem>
@@ -22,7 +22,7 @@
</listitem>
<listitem>
<simpara>
- <emphasis role="underline">_defined_macro_</emphasis>
+ __defined_macro__
</simpara>
</listitem>
<listitem>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/link.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/link.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -7,7 +7,7 @@
<para>
<ulink url="http://www.boost.org/">http://www.boost.org/> <ulink url="http://www.boost.org/">Boost</ulink>
<link linkend="link-id">link-id</link> <link linkend="link-id">Link Text</link>
- <anchor id="link-id"/> <functionname alt="foo">foo</functionname> <functionname
+ <anchor id="link-id"/><functionname alt="foo">foo</functionname> <functionname
alt="foo">link text</functionname> <classname alt="foo">foo</classname> <classname
alt="foo">link text</classname> <methodname alt="foo">foo</methodname> <methodname
alt="foo">link text</methodname> <enumname alt="foo">foo</enumname> <enumname
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/quickbook-manual.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/quickbook-manual.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1549,8 +1549,8 @@
<phrase role="keyword">int</phrase> <phrase role="identifier">main</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// Sample code
-</phrase> <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World\n"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// Sample code</phrase>
+ <phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">cout</phrase> <phrase role="special"><<</phrase> <phrase role="string">"Hello, World\n"</phrase><phrase role="special">;</phrase>
<phrase role="keyword">return</phrase> <phrase role="number">0</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
@@ -2714,8 +2714,8 @@
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">foo</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, foo man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, foo man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"foo"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase>
</programlisting>
</para>
@@ -2726,8 +2726,8 @@
<programlisting><phrase role="identifier">std</phrase><phrase role="special">::</phrase><phrase role="identifier">string</phrase> <phrase role="identifier">bar</phrase><phrase role="special">()</phrase>
<phrase role="special">{</phrase>
- <phrase role="comment">// return 'em, bar man!
-</phrase> <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
+ <phrase role="comment">// return 'em, bar man!</phrase>
+ <phrase role="keyword">return</phrase> <phrase role="string">"bar"</phrase><phrase role="special">;</phrase>
<phrase role="special">}</phrase></programlisting>
</para>
<para>
@@ -2743,10 +2743,10 @@
get marked up. We use distinguishable comments following the form:
</para>
-<programlisting><phrase role="comment">//[id
-</phrase><phrase role="identifier">some</phrase> <phrase role="identifier">code</phrase> <phrase role="identifier">here</phrase>
-<phrase role="comment">//]
-</phrase></programlisting>
+<programlisting><phrase role="comment">//[id</phrase>
+<phrase role="identifier">some</phrase> <phrase role="identifier">code</phrase> <phrase role="identifier">here</phrase>
+<phrase role="comment">//]</phrase>
+</programlisting>
<para>
The first comment line above initiates a named code-snippet. This prefix
will not be visible in quickbook. The entire code-snippet in between <code><phrase
@@ -2764,8 +2764,8 @@
Special comments of the form:
</para>
-<programlisting><phrase role="comment">//` some [*quickbook] markup here
-</phrase></programlisting>
+<programlisting><phrase role="comment">//` some [*quickbook] markup here</phrase>
+</programlisting>
<para>
and:
</para>
@@ -3029,8 +3029,8 @@
<phrase role="special">:</phrase> <phrase role="special">/</phrase><phrase role="identifier">usr</phrase><phrase role="special">/</phrase><phrase role="identifier">share</phrase><phrase role="special">/</phrase><phrase role="identifier">xml</phrase><phrase role="special">/</phrase><phrase role="identifier">docbook</phrase><phrase role="special">/</phrase><phrase role="identifier">schema</phrase><phrase role="special">/</phrase><phrase role="identifier">dtd</phrase><phrase role="special">/</phrase><phrase role="number">4.2</phrase>
<phrase role="special">;</phrase>
-<phrase role="comment"># Remove this line if you're not using doxygen
-</phrase><phrase role="identifier">using</phrase> <phrase role="identifier">doxygen</phrase> <phrase role="special">;</phrase>
+<phrase role="comment"># Remove this line if you're not using doxygen</phrase>
+<phrase role="identifier">using</phrase> <phrase role="identifier">doxygen</phrase> <phrase role="special">;</phrase>
</programlisting>
<para>
The above steps are enough to get a functional BoostBook setup. Quickbook
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/simple_markup.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/simple_markup.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -10,8 +10,10 @@
role="underline">underline</emphasis> <literal>teletype</literal>
</para>
<para>
- <emphasis>/italic/</emphasis> <emphasis role="bold">*bold*</emphasis> <emphasis
- role="underline">_underline_</emphasis> <literal>=teletype=</literal>
+ //not italic// **not bold** __not underline__ ==not teletype==
+ </para>
+ <para>
+ <emphasis role="underline">odd__ edge case</emphasis>
</para>
<para>
not__underlined__hopefully
@@ -32,7 +34,7 @@
_Should not underline escaped markup_. _or this escaped_ markup form.
</para>
<para>
- <literal>Matti Meikäläinen</literal>
+ <literal>Matti Meik\u00E4l\u00E4inen</literal>
</para>
<para>
<literal>replaced</literal>
@@ -41,13 +43,16 @@
<emphasis role="underline">replaced</emphasis>
</para>
<para>
- <literal>_macro_</literal>
+ <literal>_mac\ ro_</literal>
</para>
<para>
- /not italic/
+ <emphasis>not italic\</emphasis>
</para>
<para>
These shouldn't be interepted as markup: == // **
</para>
+ <para>
+ <literal><</literal> <literal>\<</literal> <literal>\\<</literal>
+ </para>
</section>
</article>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/simple_markup.quickbook (original)
+++ branches/quickbook-dev/tools/quickbook/test/simple_markup.quickbook 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -8,7 +8,9 @@
/italic/ *bold* _underline_ =teletype=
-//italic// **bold** __underline__ ==teletype==
+//not italic// **not bold** __not underline__ ==not teletype==
+
+_odd__ edge case_
not__underlined__hopefully
@@ -35,4 +37,6 @@
These shouldn't be interepted as markup: == // **
-[endsect]
\ No newline at end of file
+=<= =\<= =\\<=
+
+[endsect]
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.cpp (original)
+++ branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1,3 +1,11 @@
+/*=============================================================================
+ Copyright (c) 2011 Daniel James
+
+ 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)
+=============================================================================*/
+
//[foo_cpp
struct Foo{
@@ -11,4 +19,4 @@
int x;
//->
};
-//]
\ No newline at end of file
+//]
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.py (original)
+++ branches/quickbook-dev/tools/quickbook/test/snippets/pass_thru.py 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1,3 +1,9 @@
+# Copyright (c) 2011 Daniel James
+#
+# 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)
+
#[foo_py
def foo:
#=print('foo')
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/src/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/src/Jamfile.v2 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1 +1,9 @@
+#
+# Copyright (c) 2011 Daniel James
+#
+# Distributed under 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)
+#
+
exe line-compare-tool : text_diff.cpp ;
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/table_1_5.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/table_1_5.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -306,7 +306,7 @@
<row>
<entry>
<para>
- <anchor id="id2"/> a<anchor id="id3"/>
+ <anchor id="id2"/>a<anchor id="id3"/>
</para>
</entry>
</row>
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/unit/Jamfile.v2 (original)
+++ branches/quickbook-dev/tools/quickbook/test/unit/Jamfile.v2 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1,3 +1,11 @@
+#
+# Copyright (c) 2011 Daniel James
+#
+# Distributed under 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)
+#
+
import testing ;
project quickbook-unit-tests
==============================================================================
--- branches/quickbook-dev/tools/quickbook/test/variablelist.gold (original)
+++ branches/quickbook-dev/tools/quickbook/test/variablelist.gold 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -96,10 +96,10 @@
<variablelist>
<title>Variable List with anchors</title>
<varlistentry>
- <term><anchor id="id2"/> a<anchor id="id3"/> </term>
+ <term><anchor id="id2"/>a<anchor id="id3"/></term>
<listitem>
<para>
- <anchor id="id4"/> b<anchor id="id5"/>
+ <anchor id="id4"/>b<anchor id="id5"/>
</para>
</listitem>
</varlistentry>
==============================================================================
--- branches/quickbook-dev/tools/regression/src/regression.py (original)
+++ branches/quickbook-dev/tools/regression/src/regression.py 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -511,11 +511,11 @@
self.unpack_tarball( self.local, self.boost_root )
elif self.have_source:
- if not self.incremental: self.command_cleanup( [ 'bin' ] )
+ if not self.incremental: self.command_cleanup( 'bin' )
else:
if self.incremental or self.force_update:
- if not self.incremental: self.command_cleanup( [ 'bin' ] )
+ if not self.incremental: self.command_cleanup( 'bin' )
else:
self.command_cleanup()
self.command_get_source()
==============================================================================
--- branches/quickbook-dev/tools/release/snapshot_download_docs.bat (original)
+++ branches/quickbook-dev/tools/release/snapshot_download_docs.bat 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -1,5 +1,5 @@
@echo off
-rem Download and unpack boost-docs.7z
+rem Download and unpack boost-release-docs.7z
rem Copyright 2008 Beman Dawes
@@ -10,6 +10,7 @@
echo Deleting old files and directories ...
del boost-docs.7z 2>nul
+del boost-release-docs.7z 2>nul
rmdir /s /q docs_temp 2>nul
mkdir docs_temp
@@ -18,13 +19,13 @@
rem where "userid" and "password" are replace with the appropriate values
copy user.txt download_docs.ftp
echo binary >>download_docs.ftp
-echo get boost-docs.7z >>download_docs.ftp
+echo get boost-release-docs.7z >>download_docs.ftp
echo bye >>download_docs.ftp
echo Running ftp script ...
ftp -d -n -i -s:download_docs.ftp boost.cowic.de
echo Unpacking 7z file ...
-7z x -y -odocs_temp boost-docs.7z
+7z x -y -odocs_temp boost-release-docs.7z
-echo Download and unpack boost-docs.7z complete!
\ No newline at end of file
+echo Download and unpack boost-release-docs.7z complete!
\ No newline at end of file
==============================================================================
--- branches/quickbook-dev/tools/release/snapshot_posix.bat (original)
+++ branches/quickbook-dev/tools/release/snapshot_posix.bat 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -16,9 +16,9 @@
echo Exporting files from subversion...
svn export --non-interactive --native-eol LF -r %BOOST_REVISION_NUMBER% http://svn.boost.org/svn/boost/branches/release posix
-echo Copying docs into posix\doc...
-pushd posix\doc
-xcopy /s /y ..\..\docs_temp\html html
+echo Copying docs into posix...
+pushd posix
+xcopy /s /y ..\docs_temp
popd
echo Setting SNAPSHOT_DATE
==============================================================================
--- branches/quickbook-dev/tools/release/snapshot_windows.bat (original)
+++ branches/quickbook-dev/tools/release/snapshot_windows.bat 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -17,9 +17,9 @@
echo Exporting files from subversion...
svn export --non-interactive --native-eol CRLF -r %BOOST_REVISION_NUMBER% http://svn.boost.org/svn/boost/branches/release windows
-echo Copying docs into windows\doc...
-pushd windows\doc
-xcopy /s /y ..\..\docs_temp\html html
+echo Copying docs into windows...
+pushd windows
+xcopy /s /y ..\docs_temp
popd
echo Setting SNAPSHOT_DATE
==============================================================================
--- branches/quickbook-dev/tools/wave/cpp.cpp (original)
+++ branches/quickbook-dev/tools/wave/cpp.cpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -143,10 +143,10 @@
"LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)",
0
};
-
+
for (int i = 0; 0 != copyright[i]; ++i)
cout << copyright[i] << endl;
-
+
return 0; // exit app
}
@@ -216,7 +216,7 @@
else {
// store this path as an user path
p->paths.push_back(t);
- }
+ }
}
};
@@ -236,7 +236,7 @@
}
return false;
}
-
+
vector<std::string> options;
std::string line;
@@ -245,7 +245,7 @@
std::string::size_type pos = line.find_first_not_of(" \t");
if (pos == std::string::npos)
continue;
-
+
// skip comment lines
if ('#' != line[pos]) {
// strip leading and trailing whitespace
@@ -281,7 +281,7 @@
}
return file;
}
-
+
///////////////////////////////////////////////////////////////////////////////
}
@@ -311,7 +311,7 @@
: print_time(false), outstrm(outstrm_)
{
}
-
+
~auto_stop_watch()
{
if (print_time) {
@@ -320,7 +320,7 @@
<< std::endl;
}
}
-
+
void set_print_time(bool print_time_)
{
print_time = print_time_;
@@ -350,7 +350,7 @@
"end-of-file while writing to the stream\n";
}
return result;
- }
+ }
///////////////////////////////////////////////////////////////////////////
// Retrieve the position of a macro definition
@@ -364,7 +364,7 @@
bool is_predefined = false;
std::vector<typename Context::token_type> parameters;
typename Context::token_sequence_type definition;
-
+
return ctx.get_macro_definition(name, has_parameters, is_predefined,
pos, parameters, definition);
}
@@ -422,7 +422,7 @@
return result;
}
-
+
///////////////////////////////////////////////////////////////////////////
// Read one logical line of text
inline bool
@@ -560,13 +560,13 @@
for (name_iterator it = ctx.macro_names_begin(); it != end; ++it)
{
typedef std::vector<context_type::token_type> parameters_type;
-
+
bool has_pars = false;
bool predef = false;
context_type::position_type pos;
parameters_type pars;
context_type::token_sequence_type def;
-
+
if (ctx.get_macro_definition(*it, has_pars, predef, pos, pars, def))
{
macronames_out << (predef ? "-P" : "-D") << *it;
@@ -666,7 +666,7 @@
std::istreambuf_iterator<char>());
#endif
}
-
+
// The preprocessing of the input stream is done on the fly behind the
// scenes during iteration over the context_type::iterator_type stream.
std::ofstream output;
@@ -871,13 +871,13 @@
ctx.get_language(), false));
}
#endif
-
+
// enable preserving comments mode
if (preserve_comments) {
ctx.set_language(
boost::wave::enable_preserve_comments(ctx.get_language()));
}
-
+
// control the generation of #line directives
if (vm.count("line")) {
int lineopt = vm["line"].as<int>();
@@ -910,7 +910,7 @@
// add include directories to the system include search paths
if (vm.count("sysinclude")) {
vector<std::string> syspaths = vm["sysinclude"].as<vector<std::string> >();
-
+
vector<std::string>::const_iterator end = syspaths.end();
for (vector<std::string>::const_iterator cit = syspaths.begin();
cit != end; ++cit)
@@ -918,7 +918,7 @@
ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*cit).c_str());
}
}
-
+
// add include directories to the include search paths
if (vm.count("include")) {
cmd_line_utils::include_paths const &ip =
@@ -934,7 +934,7 @@
// if -I- was given on the command line, this has to be propagated
if (ip.seen_separator)
ctx.set_sysinclude_delimiter();
-
+
// add system include directories to the include path
vector<std::string>::const_iterator sysend = ip.syspaths.end();
for (vector<std::string>::const_iterator syscit = ip.syspaths.begin();
@@ -943,7 +943,7 @@
ctx.add_sysinclude_path(cmd_line_utils::trim_quotes(*syscit).c_str());
}
}
-
+
// add additional defined macros
if (vm.count("define")) {
vector<std::string> const ¯os = vm["define"].as<vector<std::string> >();
@@ -979,6 +979,20 @@
}
}
+#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0
+ // suppress expansion of specified macros
+ if (vm.count("noexpand")) {
+ vector<std::string> const &noexpandmacros =
+ vm["noexpand"].as<vector<std::string> >();
+ vector<std::string>::const_iterator end = noexpandmacros.end();
+ for (vector<std::string>::const_iterator cit = noexpandmacros.begin();
+ cit != end; ++cit)
+ {
+ ctx.get_hooks().add_noexpandmacro(*cit);
+ }
+ }
+#endif
+
// maximal include nesting depth
if (vm.count("nesting")) {
int max_depth = vm["nesting"].as<int>();
@@ -989,7 +1003,7 @@
}
ctx.set_max_include_nesting_depth(max_depth);
}
-
+
// open the output file
if (vm.count("output")) {
// try to open the file, where to put the preprocessed output
@@ -1035,17 +1049,17 @@
// we assume the session to be interactive if input is stdin and output is
// stdout and the output is not inhibited
bool is_interactive = input_is_stdin && !output.is_open() && allow_output;
-
+
if (is_interactive) {
// if interactive we don't warn for missing endif's etc.
ctx.set_language(
- boost::wave::enable_single_line(ctx.get_language()));
+ boost::wave::enable_single_line(ctx.get_language()), false);
}
-
+
// analyze the input file
context_type::iterator_type first = ctx.begin();
context_type::iterator_type last = ctx.end();
-
+
// preprocess the required include files
if (vm.count("forceinclude")) {
// add the filenames to force as include files in _reverse_ order
@@ -1079,7 +1093,7 @@
do {
// loop over all generated tokens outputting the generated text
bool finished = false;
-
+
if (input_is_stdin) {
if (is_interactive)
cout << ">>> "; // prompt if is interactive
@@ -1090,16 +1104,16 @@
break; // end of input reached
first = ctx.begin(instring.begin(), instring.end());
}
-
+
bool need_to_advanve = false;
-
+
do {
try {
if (need_to_advanve) {
++first;
need_to_advanve = false;
}
-
+
while (first != last) {
// store the last known good token position
current_position = (*first).get_position();
@@ -1117,7 +1131,7 @@
else
cout << (*first).get_value();
}
-
+
// advance to the next token
++first;
}
@@ -1201,12 +1215,12 @@
<< " using a different configuration (see wave_config.hpp)."
<< endl;
}
-
+
// analyze the command line options and arguments
try {
// declare the options allowed on the command line only
po::options_description desc_cmdline ("Options allowed on the command line only");
-
+
desc_cmdline.add_options()
("help,h", "print out program usage (this message)")
("version,v", "print the version number")
@@ -1236,10 +1250,14 @@
"specify a macro to predefine (as macro[=[value]])")
("undefine,U", po::value<vector<std::string> >()->composing(),
"specify a macro to undefine")
+#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS == 0
+ ("noexpand,N", po::value<vector<std::string> >()->composing(),
+ "specify a macro name, which should not be expanded")
+#endif
("nesting,n", po::value<int>(),
"specify a new maximal include nesting depth")
;
-
+
po::options_description desc_ext ("Extended options (allowed everywhere)");
desc_ext.add_options()
@@ -1291,21 +1309,21 @@
"or 'wave.state' [-] (interactive mode only)")
#endif
;
-
+
// combine the options for the different usage schemes
po::options_description desc_overall_cmdline;
po::options_description desc_overall_cfgfile;
desc_overall_cmdline.add(desc_cmdline).add(desc_generic).add(desc_ext);
desc_overall_cfgfile.add(desc_generic).add(desc_ext);
-
+
// parse command line and store results
using namespace boost::program_options::command_line_style;
po::parsed_options opts(po::parse_command_line(argc, argv,
desc_overall_cmdline, unix_style, cmd_line_utils::at_option_parser));
po::variables_map vm;
-
+
po::store(opts, vm);
po::notify(vm);
@@ -1371,7 +1389,7 @@
cout << desc_help << endl;
return 1;
}
-
+
if (vm.count("version")) {
cout << get_version() << endl;
return 0;
==============================================================================
--- branches/quickbook-dev/tools/wave/cpp_version.hpp (original)
+++ branches/quickbook-dev/tools/wave/cpp_version.hpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -19,7 +19,7 @@
#define CPP_VERSION_FULL_STR BOOST_PP_STRINGIZE(CPP_VERSION_FULL)
-#define CPP_VERSION_DATE 20110109L
-#define CPP_VERSION_DATE_STR "20110109"
+#define CPP_VERSION_DATE 20110507L
+#define CPP_VERSION_DATE_STR "20110507"
#endif // !defined(CPP_VERSION_HPP_CE4FE67F_63F9_468D_8364_C855F89D3C5D_INCLUDED)
==============================================================================
--- branches/quickbook-dev/tools/wave/trace_macro_expansion.hpp (original)
+++ branches/quickbook-dev/tools/wave/trace_macro_expansion.hpp 2011-06-20 15:19:56 EDT (Mon, 20 Jun 2011)
@@ -17,6 +17,7 @@
#include <ostream>
#include <string>
#include <stack>
+#include <set>
#include <boost/assert.hpp>
#include <boost/config.hpp>
@@ -161,8 +162,6 @@
default_outfile(default_outfile_),
emit_relative_filenames(false)
{
- using namespace std; // some systems have time in namespace std
- time(&started_at);
}
~trace_macro_expansion()
{
@@ -186,6 +185,12 @@
return emit_relative_filenames;
}
+ // add a macro name, which should not be expanded at all (left untouched)
+ void add_noexpandmacro(std::string const& name)
+ {
+ noexpandmacros.insert(name);
+ }
+
///////////////////////////////////////////////////////////////////////////
//
// The function 'expanding_function_like_macro' is called whenever a
@@ -213,6 +218,11 @@
// invocation (starting with the opening parenthesis and ending after the
// closing one).
//
+ // The return value defines whether the corresponding macro will be
+ // expanded (return false) or will be copied to the output (return true).
+ // Note: the whole argument list is copied unchanged to the output as well
+ // without any further processing.
+ //
///////////////////////////////////////////////////////////////////////////
#if BOOST_WAVE_USE_DEPRECIATED_PREPROCESSING_HOOKS != 0
// old signature
@@ -237,8 +247,15 @@
TokenT const ¯ocall, std::vector<ContainerT> const &arguments,
IteratorT const& seqstart, IteratorT const& seqend)
{
- if (enabled_macro_counting())
- count_invocation(macrodef.get_value().c_str());
+ if (enabled_macro_counting() || !noexpandmacros.empty()) {
+ std::string name (macrodef.get_value().c_str());
+
+ if (noexpandmacros.find(name.c_str()) != noexpandmacros.end())
+ return true; // do not expand this macro
+
+ if (enabled_macro_counting())
+ count_invocation(name.c_str());
+ }
if (!enabled_macro_tracing())
return false;
@@ -356,8 +373,15 @@
TokenT const ¯odef, ContainerT const &definition,
TokenT const ¯ocall)
{
- if (enabled_macro_counting())
- count_invocation(macrodef.get_value().c_str());
+ if (enabled_macro_counting() || !noexpandmacros.empty()) {
+ std::string name (macrodef.get_value().c_str());
+
+ if (noexpandmacros.find(name.c_str()) != noexpandmacros.end())
+ return true; // do not expand this macro
+
+ if (enabled_macro_counting())
+ count_invocation(name.c_str());
+ }
if (!enabled_macro_tracing())
return false;
@@ -1021,11 +1045,14 @@
// ensure all directories for this file do exist
fs::create_directories(boost::wave::util::branch_path(fpath));
- // figure out, whether the file to open was last accessed by us
+ // figure out, whether the file has been written to by us, if yes, we
+ // append any output to this file, otherwise we overwrite it
std::ios::openmode mode = std::ios::out;
- if (fs::exists(fpath) && fs::last_write_time(fpath) >= started_at)
+ if (fs::exists(fpath) && written_by_us.find(fpath) != written_by_us.end())
mode = (std::ios::openmode)(std::ios::out | std::ios::app);
+ written_by_us.insert(fpath);
+
// close the current file
if (outputstrm.is_open())
outputstrm.close();
@@ -1435,7 +1462,7 @@
boost::filesystem::path current_outfile; // name of the current output file
stop_watch elapsed_time; // trace timings
- std::time_t started_at; // time, this process was started at
+ std::set<boost::filesystem::path> written_by_us; // all files we have written to
typedef std::pair<bool, boost::filesystem::path> output_option_type;
std::stack<output_option_type> output_options; // output option stack
@@ -1444,6 +1471,8 @@
std::map<std::string, std::size_t> counts; // macro invocation counts
bool emit_relative_filenames; // emit relative names in #line directives
+
+ std::set<std::string> noexpandmacros; // list of macros not to expand
};
#undef BOOST_WAVE_GETSTRING