translate STORE/RESTORE in XML instead of Python

This commit is contained in:
Mylloon 2024-05-07 12:24:09 +02:00
parent 24d5a33b0e
commit a90622e8e5
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 3 additions and 16 deletions

View file

@ -40,15 +40,6 @@ class System:
represented as a couple (member, interpretation)
"""
# Interpretation of extra symbols added if necessary
extra_symbols = ["[", "]"]
for _, substitution in substitutions:
if any(symbol in substitution for symbol in extra_symbols):
self.interpretations.extend(
[(extra_symbols[0], "STORE"), (extra_symbols[1], "RESTORE")]
)
break
def __repr__(self):
return pformat(object=self.__dict__, compact=True, width=120, sort_dicts=False)

View file

@ -44,7 +44,7 @@
<!-- Membre d'une interprétation -->
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z|\[|\]]{1}" />
<xs:pattern value="[A-Z]{1}" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>

View file

@ -72,10 +72,6 @@
<xsl:choose>
<!-- Si pas de substitution trouvé, alors on renvoie le caractère
tel qu'il est -->
<!-- TODO: Est-ce la meilleur chose à faire ?
On pourrait dire que [ = [ et ] = ] dans le script python
et ainsi ça ouvrirais la porte à autoriser des substitution
vide -->
<xsl:when test="not($sub)">
<xsl:value-of select="current()" />
</xsl:when>
@ -126,12 +122,12 @@
</xsl:when>
<!-- Store -->
<xsl:when test="$action = 'STORE'">
<xsl:when test="current() = '['">
<store />
</xsl:when>
<!-- Restore -->
<xsl:when test="$action = 'RESTORE'">
<xsl:when test="current() = ']'">
<restore />
</xsl:when>