translate STORE/RESTORE in XML instead of Python
This commit is contained in:
parent
24d5a33b0e
commit
a90622e8e5
3 changed files with 3 additions and 16 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
Reference in a new issue