Extract classify/@terminate into own template
Note that next-match does not cause a return from the template, as odd as it looks.master
parent
1517a03994
commit
97caefab1b
|
@ -635,6 +635,21 @@
|
|||
</template>
|
||||
|
||||
|
||||
<template mode="compile" priority="7"
|
||||
match="lv:classify[ @terminate='true' ]">
|
||||
<next-match />
|
||||
|
||||
<variable name="var" as="xs:string"
|
||||
select="compiler:class-var( . )" />
|
||||
|
||||
<text>if (_canterm && </text>
|
||||
<value-of select="$var" />
|
||||
<text>) throw Error( '</text>
|
||||
<value-of select="replace( @desc, '''', '\\''' )" />
|
||||
<text>');</text>
|
||||
</template>
|
||||
|
||||
|
||||
<!--
|
||||
Raise $inner of type $from to $outer of type $to with universal or
|
||||
existential ($ue) quantification
|
||||
|
@ -756,17 +771,6 @@
|
|||
|
||||
<sequence select="concat( $var, '=', $reduce,
|
||||
'(', $yield-to, '=', $js, ');' )" />
|
||||
|
||||
<!-- support termination on certain classifications (useful for eligibility
|
||||
and error conditions) -->
|
||||
<if test="$classify/@terminate = 'true'">
|
||||
<text>if (_canterm && </text>
|
||||
<value-of select="$var" />
|
||||
<text>) throw Error( '</text>
|
||||
<value-of select="replace( $classify/@desc, '''', '\\''' )" />
|
||||
<text>');</text>
|
||||
<value-of select="$compiler:nl" />
|
||||
</if>
|
||||
</function>
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue