Remove unused lv:assuming

This was going to be a feature to permit testing (I think?), but it has
never been used and was abandoned long ago.
master
Mike Gerwitz 2021-01-14 15:05:16 -05:00
parent 05736abe23
commit 9784ef9326
3 changed files with 8 additions and 102 deletions

View File

@ -733,27 +733,17 @@
<variable name="input-raw">
<choose>
<!-- if we have assumptions, then we'll be recalculating (rather than
referencing) an existing classification -->
<when test="lv:assuming">
<text>_cassume</text>
<when test="$sym-on/@type = 'const'">
<text>C</text>
</when>
<otherwise>
<choose>
<when test="$sym-on/@type = 'const'">
<text>C</text>
</when>
<otherwise>
<text>A</text>
</otherwise>
</choose>
<text>['</text>
<value-of select="translate( @on, &quot;'&quot;, '' )" />
<text>']</text>
<text>A</text>
</otherwise>
</choose>
<text>['</text>
<value-of select="translate( @on, &quot;'&quot;, '' )" />
<text>']</text>
</variable>
<!-- yields (if not set, generate one so that cmatches still works properly)
@ -788,22 +778,6 @@
</choose>
</variable>
<if test="lv:assuming">
<text>(function(){</text>
<!-- initialize variable (ensuring that the closure we're about to generate
will properly assign the value rather than encapsulate it) -->
<text>var </text>
<value-of select="$input-raw" />
<text>; </text>
<!-- generate assumptions and recursively generate the referenced
classification -->
<apply-templates select="." mode="compile-match-assumptions">
<with-param name="result-var" select="$input-raw" />
</apply-templates>
<text>; return </text>
</if>
<!-- invoke the classification matcher on this input -->
<text>anyValue( </text>
<value-of select="$input" />
@ -910,14 +884,7 @@
</if>
<!-- end of anyValue() call -->
<text>)</text>
<!-- end of assuming function call -->
<if test="lv:assuming">
<text>})()</text>
</if>
<text>;</text>
<text>);</text>
<text>/*!+*/(D['</text>
<value-of select="@_id" />

View File

@ -304,33 +304,6 @@
<apply-templates mode="lvv:validate-match" />
</template>
<!--
Classification match assumptions must operate only on other classifiers and
must assume values that the referenced classifier actually matches on
-->
<template match="lv:match/lv:assuming" mode="lvv:validate-match" priority="5">
<variable name="on" select="../@on" />
<variable name="ref" select="root(.)//lv:classify[ @yields=$on ]" />
<!-- assumptions must only operate on variables mentioned in the referenced
classification -->
<for-each select="
.//lv:that[
not( @name=$ref//lv:match/@on )
]
">
<call-template name="lvv:error">
<with-param name="desc" select="'Invalid classification assumption'" />
<with-param name="refnode" select="." />
<with-param name="content">
<value-of select="@name" />
<text> is not used to classify </text>
<value-of select="$on" />
</with-param>
</call-template>
</for-each>
</template>
<template match="c:*" mode="lvv:validate-match" priority="2">
<apply-templates select="." mode="lvv:validate" />

View File

@ -1193,44 +1193,10 @@
<xsl:text> must </xsl:text>
<xsl:apply-templates select="." mode="match-desc" />
<xsl:if test="lv:assuming">
<xsl:text>, assuming that:</xsl:text>
<ul>
<xsl:for-each select="lv:assuming/lv:that">
<li>
<!-- link to the ref -->
<a>
<xsl:attribute name="href">
<xsl:text>#</xsl:text>
<xsl:value-of select="@name" />
</xsl:attribute>
<xsl:value-of select="@name" />
</a>
<xsl:text> </xsl:text>
<xsl:apply-templates select="." />
</li>
</xsl:for-each>
</ul>
</xsl:if>
</p>
</xsl:template>
<xsl:template match="lv:assuming/lv:that[ @ignored ]" priority="5">
<xsl:text>is ignored during classification</xsl:text>
</xsl:template>
<!-- we only do consts right now -->
<xsl:template match="lv:assuming/lv:that" priority="1">
<xsl:text>has the value </xsl:text>
<xsl:value-of select="@const" />
</xsl:template>
<!--
Outputs a type match in plain english