Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-04-05 15:53:54 -0400
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-04-05 15:53:54 -0400
commit986b2a7b4b4afa6f8be27319a779e1bba466dbd6 (patch)
treeeb060052da2444f31ce382440e88d27b7067a478 /src
parentc15ed8a2cd69237375a1ee7daf2e574d9586db2c (diff)
downloadtame-986b2a7b4b4afa6f8be27319a779e1bba466dbd6.tar.gz
tame-986b2a7b4b4afa6f8be27319a779e1bba466dbd6.tar.bz2
tame-986b2a7b4b4afa6f8be27319a779e1bba466dbd6.zip
map: Provide useful warnings when missing import/@path
This is all really confusing because this doesn't use the same import specification as packages; maps got stuck in a partial transition. So, let's provide some helpful errors rather than silently failing. * src/current/compiler/map.xsl (preproc:symtable)[lvm:import]: Error if missing `@path'. Provide more information if `@package' was provided to help clarify.
Diffstat (limited to 'src')
-rw-r--r--src/current/compiler/map.xsl12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/current/compiler/map.xsl b/src/current/compiler/map.xsl
index 82867de..e18c1e4 100644
--- a/src/current/compiler/map.xsl
+++ b/src/current/compiler/map.xsl
@@ -869,13 +869,23 @@
<!-- import symbols -->
-<template match="lvm:import[ @path ]" mode="preproc:symtable" priority="5">
+<template match="lvm:import" mode="preproc:symtable" priority="5">
<!-- original root passed to sym-discover -->
<param name="orig-root" />
<variable name="src" as="xs:string"
select="@path" />
+ <if test="not( @path )">
+ <message terminate="yes"
+ select="concat(
+ 'fatal: import missing @path',
+ if ( @package ) then
+ ' (use instead of @package)'
+ else
+ () )" />
+ </if>
+
<!-- perform symbol import -->
<call-template name="preproc:symimport">
<with-param name="orig-root" select="$orig-root" />