Remove legacy classification system flag

This should have been cleaned up long ago; it hasn't been used for a couple
of years now.

DEV-10806
main
Mike Gerwitz 2023-10-05 11:53:35 -04:00
parent 5e883e3c4f
commit b0eca41c96
3 changed files with 25 additions and 95 deletions

View File

@ -41,8 +41,6 @@
<!-- legacy classification system -->
<include href="js-legacy.xsl" />
<!-- and whether to enable it (set to non-empty string) -->
<param name="legacy-classify" select="''" />
<!-- calculation compiler -->
<include href="js-calc.xsl" />
@ -641,20 +639,6 @@
</function>
<template mode="compile" priority="6"
match="lv:classify[ compiler:use-legacy-classify() ]">
<param name="symtable-map" as="map(*)" tunnel="yes" />
<sequence select="concat(
$compiler:nl,
'/*!lc*/',
string-join(
compiler:compile-classify-legacy( $symtable-map, . ),
'' ),
'/*lc!*/' )" />
</template>
<template match="lv:classify" mode="compile" priority="5">
<param name="symtable-map" as="map(*)" tunnel="yes" />
@ -664,8 +648,7 @@
<template mode="compile" priority="8"
match="lv:classify[
@preproc:inline='true'
and not( compiler:use-legacy-classify() ) ]">
@preproc:inline='true' ]">
<!-- emit nothing; it'll be inlined at the match site -->
</template>
@ -708,14 +691,6 @@
</function>
<function name="compiler:use-legacy-classify" as="xs:boolean">
<variable name="flagname" as="xs:string"
select="'___feature-newclassify'" />
<sequence select="$legacy-classify != ''" />
</function>
<function name="compiler:compile-classify-assign" as="xs:string">
<param name="symtable-map" as="map(*)" />
<param name="classify" as="element( lv:classify )" />
@ -2476,39 +2451,19 @@
]]>
</text>
<choose>
<when test="compiler:use-legacy-classify()">
<text>
function div(x, y)
{
return x / y;
}
<text>
function div(x, y)
{
if (y === 0) return 0;
return x / y;
}
function pow(x, p)
{
return Math.pow(x, p);
}
</text>
</when>
<!-- x/0=0 introduced with new classification system; see commit message
for more detailed information -->
<otherwise>
<text>
function div(x, y)
{
if (y === 0) return 0;
return x / y;
}
function pow(x, p)
{
if (x === 0) return 0;
return Math.pow(x, p);
}
</text>
</otherwise>
</choose>
function pow(x, p)
{
if (x === 0) return 0;
return Math.pow(x, p);
}
</text>
<sequence select="unparsed-text(
concat( $__path-root, '/src/js/sha256.js' ) )" />

View File

@ -270,29 +270,15 @@
<template match="lv:match[@pattern]" mode="lvv:validate-match" priority="9">
<choose>
<!-- warn of upcoming removal -->
<when test="compiler:use-legacy-classify()">
<message select="concat( 'warning: ',
ancestor::lv:classify/@as,
': lv:match[@pattern] support is deprecated ',
'and is removed with the new classification ',
'system; use lookup tables instead' )" />
</when>
<!-- @pattern support removed in the new classification system -->
<otherwise>
<call-template name="lvv:error">
<with-param name="desc" select="'lv:match[@pattern] support removed'" />
<with-param name="refnode" select="." />
<with-param name="content">
<text>use lookup tables in place of @pattern in `</text>
<value-of select="parent::lv:classify/@as" />
<text>'</text>
</with-param>
</call-template>
</otherwise>
</choose>
<call-template name="lvv:error">
<with-param name="desc" select="'lv:match[@pattern] support removed'" />
<with-param name="refnode" select="." />
<with-param name="content">
<text>use lookup tables in place of @pattern in `</text>
<value-of select="parent::lv:classify/@as" />
<text>'</text>
</with-param>
</call-template>
</template>

View File

@ -288,11 +288,7 @@
( lv:any | lv:all )
and not( eseq:is-expandable(.) ) ]">
<variable name="result">
<apply-templates select="." mode="preproc:class-groupgen">
<with-param name="legacy-classify"
select="compiler:use-legacy-classify()"
tunnel="yes" />
</apply-templates>
<apply-templates select="." mode="preproc:class-groupgen" />
</variable>
<apply-templates select="$result/lv:classify" mode="preproc:class-extract" />
@ -413,8 +409,6 @@
<template match="lv:any|lv:all" mode="preproc:class-groupgen" priority="5">
<param name="legacy-classify" as="xs:boolean" tunnel="yes" />
<variable name="id" select="preproc:pkg-generate-id(.)" />
<variable name="parent-name" select="ancestor::lv:classify/@as" />
@ -430,19 +424,14 @@
<attribute name="any" select="'true'" />
</if>
<if test="not( $legacy-classify )">
<attribute name="preproc:inline" select="'true'" />
</if>
<attribute name="preproc:inline" select="'true'" />
<apply-templates mode="preproc:class-groupgen" />
</lv:classify>
<!-- this will remain in its place -->
<lv:match on="{$yields}" value="TRUE"
preproc:generated="true">
<if test="not( $legacy-classify )">
<attribute name="preproc:inline" select="'true'" />
</if>
<attribute name="preproc:inline" select="'true'" />
</lv:match>
</template>