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.
master
Mike Gerwitz 2018-04-05 15:53:54 -04:00
parent c15ed8a2cd
commit 986b2a7b4b
1 changed files with 11 additions and 1 deletions

View File

@ -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" />