diff options
author | Mike Gerwitz <gerwitzm@lovullo.com> | 2016-11-17 08:52:37 -0500 |
---|---|---|
committer | Mike Gerwitz <gerwitzm@lovullo.com> | 2016-11-17 23:55:23 -0500 |
commit | c199f4739e17e841d90d6bfffce3806b8d0f2254 (patch) | |
tree | 513e25644c4f36e7e90438891d9aa555e75a020f /src | |
parent | 246ccbb1db561c4f133294c0f2eed7171647794a (diff) | |
download | tame-c199f4739e17e841d90d6bfffce3806b8d0f2254.tar.gz tame-c199f4739e17e841d90d6bfffce3806b8d0f2254.tar.bz2 tame-c199f4739e17e841d90d6bfffce3806b8d0f2254.zip |
Extract template symbol generation
* src/current/include/preproc/symtable.xsl
(preproc:symtable)[lv:template]: Extracted template.
* src/symtable/symbols.xsl:
(preproc:symtable)[lv:template]: Added template.
test/symtable/symbols.xsl: Added test case.
Diffstat (limited to 'src')
-rw-r--r-- | src/current/include/preproc/symtable.xsl | 8 | ||||
-rw-r--r-- | src/symtable/symbols.xsl | 42 |
2 files changed, 42 insertions, 8 deletions
diff --git a/src/current/include/preproc/symtable.xsl b/src/current/include/preproc/symtable.xsl index e7ead95..245a78d 100644 --- a/src/current/include/preproc/symtable.xsl +++ b/src/current/include/preproc/symtable.xsl @@ -670,14 +670,6 @@ </xsl:template> -<xsl:template match="lv:template" mode="preproc:symtable" priority="9"> - <!-- do not process template bodies; we're only interested in the symbols - they produce after expansion --> - <preproc:sym name="{@name}" - type="tpl" dim="0" desc="{@desc}" /> -</xsl:template> - - <xsl:template match="lv:rate" mode="preproc:symtable" priority="5"> <xsl:variable name="external" select="boolean( @external='true' )" /> diff --git a/src/symtable/symbols.xsl b/src/symtable/symbols.xsl index 21bf54b..ddfbfca 100644 --- a/src/symtable/symbols.xsl +++ b/src/symtable/symbols.xsl @@ -246,7 +246,49 @@ statically into the program for static reference without having to actually invoke the program. @end table + + + @menu + * Templates: Template Symbols. @code{tpl} + @end menu +--> + + +<!-- + @node Template Symbols + @subsection Template Symbols + + Templates produce a single @code{tpl}@tie{}symbol representing the + macro itself. + At the time of parsing, + we do not care about the body of the template@mdash{ + }when applied, it will expand into code that will be further + processed recursively during another pass to produce the + appropriate symbols for that expansion. +--> + +<!-- + Produce a @code{tpl} symbol with the following attributes: + + @table @code + @item name + Name of the template as provided by @pkgns{template/@@name}. + + @item dim + Always @samp{0}; + templates are processed as macros before compilation. + + @item desc + Template description as provided by @pkgns{template/@@desc}. + @end table --> +<template mode="preproc:symtable" priority="5" + match="lv:template"> + <preproc:sym type="tpl" + name="{@name}" + dim="0" + desc="{@desc}" /> +</template> </stylesheet> |