Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <gerwitzm@lovullo.com>2016-11-17 08:55:07 -0500
committerMike Gerwitz <gerwitzm@lovullo.com>2016-11-17 23:55:23 -0500
commitf396858fb18b915a0f03e6d02c4aebb55b0000bc (patch)
treed28c7edccab6573199093c42a4d7d0309dfc84d6 /src/symtable/symbols.xsl
parentc199f4739e17e841d90d6bfffce3806b8d0f2254 (diff)
downloadtame-f396858fb18b915a0f03e6d02c4aebb55b0000bc.tar.gz
tame-f396858fb18b915a0f03e6d02c4aebb55b0000bc.tar.bz2
tame-f396858fb18b915a0f03e6d02c4aebb55b0000bc.zip
Extracted meta symbol generation
* src/current/include/preproc/symtable.xsl (preproc:symtable)[lv:meta]: Extracted template. * src/symtable/symbols.xsl (preproc:symtable)[lv:meta]: Added template. * test/symtable/symbols.xsl (lv:meta): Scenario added
Diffstat (limited to 'src/symtable/symbols.xsl')
-rw-r--r--src/symtable/symbols.xsl42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/symtable/symbols.xsl b/src/symtable/symbols.xsl
index ddfbfca..14949c7 100644
--- a/src/symtable/symbols.xsl
+++ b/src/symtable/symbols.xsl
@@ -250,6 +250,7 @@
@menu
* Templates: Template Symbols. @code{tpl}
+ * Program Metadata: Program Metadata Symbols. @code{meta}
@end menu
-->
@@ -291,4 +292,45 @@
</template>
+<!--
+ @node Program Metadata Symbols
+ @subsection Program Metadata Symbols
+
+ A basic key-value system allows for compiling static metadata into
+ the program.
+ These metadata can be referenced externally without having to run
+ the program.
+-->
+
+<!--
+ Produce a @code{meta} symbol for each @pkgns{meta/}@pkgns{prop} with
+ the following attributes:
+
+ @table @code
+ @item name
+ The metavalue name as provided by @pkgns{prop/@@name},
+ prefixed with @samp{:meta:} to avoid conflicts with other
+ symbols.
+
+ @item desc
+ Generic description including @code{name}.
+
+ @item keep
+ Always @samp{true}.
+ @end table
+
+ The @code{name} prefix enforces separation between the two
+ compilation stages by preventing conflicts.
+-->
+<template mode="preproc:symtable" priority="5"
+ match="lv:meta">
+ <for-each select="lv:prop">
+ <preproc:sym type="meta"
+ name=":meta:{@name}"
+ desc="Metavalue {@name}"
+ keep="true" />
+ </for-each>
+</template>
+
+
</stylesheet>