Add expand-barrier and skip-child-expansion

It's going to be like TeX before you know it... ._.

* src/current/include/preproc/package.xsl (preproc:tpl-check)
  [lv:template|lv:const|lv:typedef|lv:param-copy]: Add lv:param-copy.
* src/current/include/preproc/template.xsl (preproc:apply-template)
 [lv:expand-barrier, lv:skip-child-expansion]: New expansion control
   structures.
master
Mike Gerwitz 2018-10-30 14:22:31 -04:00
parent 7ac4c1ce9d
commit 07e5dbd94b
2 changed files with 22 additions and 1 deletions

View File

@ -259,7 +259,7 @@
<!-- skip things that cannot contain template applications -->
<xsl:template match="lv:template|lv:const|lv:typedef"
<xsl:template match="lv:template|lv:const|lv:typedef|lv:param-copy"
mode="preproc:tpl-check" priority="9">
</xsl:template>

View File

@ -584,6 +584,27 @@
</xsl:template>
<!--
Halt expansion at this point and remove the barrier for future expansions
-->
<xsl:template match="lv:expand-barrier" mode="preproc:apply-template" priority="5">
<xsl:sequence select="node()" />
</xsl:template>
<!--
Leave immediate children alone but continue expanding grandchildren
-->
<xsl:template match="lv:skip-child-expansion" mode="preproc:apply-template" priority="5">
<xsl:for-each select="element()">
<xsl:copy>
<xsl:copy-of select="@*" />
<xsl:apply-templates mode="preproc:apply-template" />
</xsl:copy>
</xsl:for-each>
</xsl:template>
<!--
Preprocesses template nodes