Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-25 13:56:47 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2019-10-25 13:56:47 -0400
commit3ef6571922fbef6ebbf30d76200a5b9dd2a592eb (patch)
treee8475b6a92c38c270d7175f19e6c87cf200804bd /src
parente97f7a75c9258eb58e429c56492a40edb0cd57e0 (diff)
downloadtame-3ef6571922fbef6ebbf30d76200a5b9dd2a592eb.tar.gz
tame-3ef6571922fbef6ebbf30d76200a5b9dd2a592eb.tar.bz2
tame-3ef6571922fbef6ebbf30d76200a5b9dd2a592eb.zip
Provide friendly lv:param-typedef-lookup failure for duplicate item values
The real solution is to disallow typedefs from getting into this state to begin with, but I don't have time for that right now.
Diffstat (limited to 'src')
-rw-r--r--src/current/include/preproc/template.xsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/current/include/preproc/template.xsl b/src/current/include/preproc/template.xsl
index 5610ba2..24efaaf 100644
--- a/src/current/include/preproc/template.xsl
+++ b/src/current/include/preproc/template.xsl
@@ -1386,6 +1386,14 @@
select="$typedef//lv:item[ @value = $query-value ]/@name" />
<choose>
+ <when test="count( $const-name ) gt 1">
+ <message terminate="yes"
+ select="concat( 'error: the value ''', $query-value, ''' ',
+ 'is associated with more than one item in ''',
+ $tname, ''': ',
+ string-join( $const-name, ', ' ) )" />
+ </when>
+
<when test="not( $const-name )">
<!-- error out only if lookup failures aren't explicitly suppressed -->
<if test="not( @ignore-missing = 'true' )">