1
1
mirror of https://github.com/kanaka/mal.git synced 2024-10-26 14:22:25 +03:00

be more spec-compatible with readline

This commit is contained in:
AnotherTest 2020-02-25 23:27:34 +03:30
parent 4c50b6736b
commit c77e046409
2 changed files with 10 additions and 2 deletions

View File

@ -29,7 +29,14 @@
<xsl:variable name="apos" select='"&apos;"'></xsl:variable>
<xsl:value-of select="error(QName('MAL', 'Error'), concat($apos, $name, $apos, ' not found'), fn:makeMALValue(concat($apos, $name, $apos, ' not found'), 'string'))" />
</xsl:when>
<xsl:otherwise><xsl:sequence select="parse-xml($value)"/></xsl:otherwise>
<xsl:otherwise>
<xsl:try>
<xsl:sequence select="parse-xml($value)"/>
<xsl:catch errors="*">
<xsl:sequence select="$value"/>
</xsl:catch>
</xsl:try>
</xsl:otherwise>
</xsl:choose>
</xsl:function>

View File

@ -836,7 +836,8 @@ ENV IS <xsl:sequence select="$value/env/@data => env:deserialise()"/>
<xsl:message>
<request kind="readline" value="{$args/value/malval/lvalue/malval[1]/@value}"/>
</xsl:message>
<xsl:sequence select="core:makeMALType(unparsed-text('xsl_input-string'), 'string')"/>
<xsl:variable name="str" select="unparsed-text('xsl_input-string')"></xsl:variable>
<xsl:sequence select="core:makeMALType($str, if (string-length($str) = 0) then 'nil' else 'string')"/>
<xsl:sequence select="env"/>
<xsl:sequence select="$atoms"/>
</xsl:when>