Boost logo

Boost-Commit :

From: daniel_james_at_[hidden]
Date: 2008-05-05 07:38:26


Author: danieljames
Date: 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
New Revision: 45135
URL: http://svn.boost.org/trac/boost/changeset/45135

Log:
Support for pack expansions in template specializations.

Text files modified:
   branches/doc/tools/boostbook/doc/reference.dtdxml | 10 +++++++++-
   branches/doc/tools/boostbook/doc/reference.xml | 1 +
   branches/doc/tools/boostbook/dtd/boostbook.dtd | 4 +++-
   branches/doc/tools/boostbook/xsl/lookup.xsl | 32 ++++++++++++++------------------
   branches/doc/tools/boostbook/xsl/template.xsl | 3 +++
   5 files changed, 30 insertions(+), 20 deletions(-)

Modified: branches/doc/tools/boostbook/doc/reference.dtdxml
==============================================================================
--- branches/doc/tools/boostbook/doc/reference.dtdxml (original)
+++ branches/doc/tools/boostbook/doc/reference.dtdxml 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
@@ -1669,7 +1669,9 @@
 </element>
 
 <attlist name="template-arg">
-<attdecl> %boost.common.attrib;</attdecl>
+<attdecl>
+ pack CDATA #IMPLIED
+ %boost.common.attrib;</attdecl>
 <attribute name="last-revision"
            type="#IMPLIED"
            value="CDATA"
@@ -1678,6 +1680,12 @@
            type="#IMPLIED"
            value="CDATA"
            default=""/>
+<attribute name="pack"
+ type="#IMPLIED"
+ value="CDATA"
+ default="">
+ <purpose>Set to '1' if this is a pack exapansion.</purpose>
+</attribute>
 <attribute name="xml:base"
            type="#IMPLIED"
            value="CDATA"

Modified: branches/doc/tools/boostbook/doc/reference.xml
==============================================================================
--- branches/doc/tools/boostbook/doc/reference.xml (original)
+++ branches/doc/tools/boostbook/doc/reference.xml 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
@@ -1302,6 +1302,7 @@
 
 <row><entry>last-revision</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to $Date$ to keep "last revised" information in sync with CVS changes</entry></row>
 <row><entry>id</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>A global identifier for this element</entry></row>
+<row><entry>pack</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Set to '1' if this is a pack exapansion.</entry></row>
 <row><entry>xml:base</entry><entry>#IMPLIED</entry><entry>CDATA</entry><entry>Implementation detail used by XIncludes</entry></row>
 </tbody>
         </tgroup>

Modified: branches/doc/tools/boostbook/dtd/boostbook.dtd
==============================================================================
--- branches/doc/tools/boostbook/dtd/boostbook.dtd (original)
+++ branches/doc/tools/boostbook/dtd/boostbook.dtd 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
@@ -183,7 +183,9 @@
 <!ATTLIST specialization %boost.common.attrib;>
 
 <!ELEMENT template-arg ANY>
-<!ATTLIST template-arg %boost.common.attrib;>
+<!ATTLIST template-arg
+ pack CDATA #IMPLIED
+ %boost.common.attrib;>
 
 <!ELEMENT default ANY>
 <!ATTLIST default %boost.common.attrib;>

Modified: branches/doc/tools/boostbook/xsl/lookup.xsl
==============================================================================
--- branches/doc/tools/boostbook/xsl/lookup.xsl (original)
+++ branches/doc/tools/boostbook/xsl/lookup.xsl 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
@@ -194,29 +194,25 @@
     <xsl:value-of select="@name"/>
   </xsl:template>
 
- <xsl:template name="print-specialization-name">
+ <xsl:template match="template-arg" mode="print-name">
+ <xsl:if test="position() &gt; 1">
+ <xsl:text>, </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="text()"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template
+ match="struct-specialization|class-specialization|union-specialization"
+ mode="print-name">
     <xsl:value-of select="@name"/>
     <xsl:text>&lt;</xsl:text>
- <xsl:value-of select="specialization/template-arg[position() = 1]/text()"/>
- <xsl:for-each select="specialization/template-arg[position() &gt; 1]">
- <xsl:text>,</xsl:text>
- <xsl:value-of select="text()"/>
- </xsl:for-each>
+ <xsl:apply-templates select="specialization/template-arg" mode="print-name"/>
     <xsl:text>&gt;</xsl:text>
   </xsl:template>
 
- <xsl:template match="struct-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="class-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
- <xsl:template match="union-specialization" mode="print-name">
- <xsl:call-template name="print-specialization-name"/>
- </xsl:template>
-
   <xsl:template name="name-matches-node">
     <!-- The name we are looking for -->
     <xsl:param name="name"/>

Modified: branches/doc/tools/boostbook/xsl/template.xsl
==============================================================================
--- branches/doc/tools/boostbook/xsl/template.xsl (original)
+++ branches/doc/tools/boostbook/xsl/template.xsl 2008-05-05 07:38:25 EDT (Mon, 05 May 2008)
@@ -440,6 +440,9 @@
       <xsl:text>, </xsl:text>
     </xsl:if>
     <xsl:apply-templates mode="highlight"/>
+ <xsl:if test="@pack=1">
+ <xsl:text>...</xsl:text>
+ </xsl:if>
   </xsl:template>
 </xsl:stylesheet>
 


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