SVG: fix HMI:Assign widget to properly handle single-letter variable names.
--- a/svghmi/gen_index_xhtml.xslt Thu Mar 28 12:07:24 2024 +0100
+++ b/svghmi/gen_index_xhtml.xslt Wed Apr 03 14:17:50 2024 +0200
@@ -2907,7 +2907,7 @@
</xsl:if>
</xsl:for-each>
</xsl:variable>
- <xsl:variable name="isVarName" select="regexp:test($value,'^[a-zA-Z_][a-zA-Z0-9_]+$')"/>
+ <xsl:variable name="isVarName" select="regexp:test($value,'^[a-zA-Z_][a-zA-Z0-9_]*$')"/>
<xsl:choose>
<xsl:when test="$isVarName">
<xsl:text> const </xsl:text>
--- a/svghmi/widget_assign.ysl2 Thu Mar 28 12:07:24 2024 +0100
+++ b/svghmi/widget_assign.ysl2 Wed Apr 03 14:17:50 2024 +0200
@@ -71,7 +71,7 @@
const "name","substring-before(@value,'=')";
const "value","substring-after(@value,'=')";
const "index" foreach "$paths" if "@assign = $name" value "position()-1";
- const "isVarName", "regexp:test($value,'^[a-zA-Z_][a-zA-Z0-9_]+$')";
+ const "isVarName", "regexp:test($value,'^[a-zA-Z_][a-zA-Z0-9_]*$')";
choose {
when "$isVarName"{
| const «$value» = this.assignments["«$value»"];