diff options
author | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-01-29 13:11:12 -0500 |
---|---|---|
committer | Mike Gerwitz <mike.gerwitz@rtspecialty.com> | 2018-01-29 13:14:02 -0500 |
commit | 440b935dc0861d549a9bb77b75aa76447b172ee9 (patch) | |
tree | 83c70bd2a109f2113257cb6c39db70a164978342 | |
parent | 00ce03ab252b7288505a1ce12875fbb69d86a62d (diff) | |
download | tame-440b935dc0861d549a9bb77b75aa76447b172ee9.tar.gz tame-440b935dc0861d549a9bb77b75aa76447b172ee9.tar.bz2 tame-440b935dc0861d549a9bb77b75aa76447b172ee9.zip |
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.
-rw-r--r-- | src/current/compiler/js.xsl | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/current/compiler/js.xsl b/src/current/compiler/js.xsl index c004ca5..c3f4177 100644 --- a/src/current/compiler/js.xsl +++ b/src/current/compiler/js.xsl @@ -811,19 +811,20 @@ select="root(.)/preproc:symtable/preproc:sym[ @name=$value ]" /> <choose> - <!-- 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"> + <!-- value unavailable (TODO: vector/matrix support) --> + <when test="$sym and not( $sym/@value )"> <message> - <text>[jsc] !!! TODO: bad classification match: '</text> + <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> + <otherwise> <text>'</text> <!-- TODO: Should we disallow entirely? --> |