Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-01-31 10:27:29 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-02-01 13:08:03 -0500
commitc0370690f440f961c23297c2fe5a231727470a9c (patch)
tree53ade3efbcf8770fa538c2f3308f2fbcf870ec46
parent9c4fbdace9e3d488bdb3666817953df068349ade (diff)
downloadtame-c0370690f440f961c23297c2fe5a231727470a9c.tar.gz
tame-c0370690f440f961c23297c2fe5a231727470a9c.tar.bz2
tame-c0370690f440f961c23297c2fe5a231727470a9c.zip
validate: Error on nested rate blocks (bugfix)
* src/current/compiler/validate.xsl (lvv:validate) [lv:rate[ancestor::lv:rate]]: Error on nested rate block.
-rw-r--r--src/current/compiler/validate.xsl18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/current/compiler/validate.xsl b/src/current/compiler/validate.xsl
index e4dc74d..1a48376 100644
--- a/src/current/compiler/validate.xsl
+++ b/src/current/compiler/validate.xsl
@@ -682,6 +682,24 @@
<!--
+ Rate block cannot be nested.
+-->
+<xsl:template mode="lvv:validate" priority="8"
+ match="lv:rate[ ancestor::lv:rate ]">
+ <xsl:variable name="within" as="element( lv:rate )"
+ select="ancestor::lv:rate[1]" />
+
+ <xsl:call-template name="lvv:error">
+ <xsl:with-param name="desc" select="'Nested rate block'" />
+ <xsl:with-param name="refnode" select="." />
+ <xsl:with-param name="content"
+ select="concat( '`', @yields, ''' cannot be nested ',
+ 'within `', $within/@yields, '''' )" />
+ </xsl:call-template>
+</xsl:template>
+
+
+<!--
Throws an error if a generator is requested using unsupported data
Specifically, a generator is intended to generate a set from an expression