Display error on non-scalar constant lv:match/@value (bugfix)

* src/current/compiler/js.xsl (compile)[lv:match]: Display error on bad
  match, as it was intended.
master
Mike Gerwitz 2018-01-29 13:11:12 -05:00
parent 00ce03ab25
commit 440b935dc0
1 changed files with 9 additions and 8 deletions

View File

@ -811,19 +811,20 @@
select="root(.)/preproc:symtable/preproc:sym[ @name=$value ]" />
<choose>
<!-- value unavailable (TODO: vector/matrix support) -->
<when test="$sym and not( $sym/@value )">
<message>
<text>[jsc] !!! bad classification match: `</text>
<value-of select="$value" />
<text>' is not a scalar constant</text>
</message>
</when>
<!-- simple constant -->
<when test="$sym and @value">
<value-of select="$sym/@value" />
</when>
<!-- value unavailable (XXX: this probably should never happen...) -->
<when test="$sym and @value">
<message>
<text>[jsc] !!! TODO: bad classification match: '</text>
<value-of select="$value" />
</message>
</when>
<otherwise>
<text>'</text>
<!-- TODO: Should we disallow entirely? -->