Skip to content

Commit e184458

Browse files
authored
Merge pull request #3913 from maxonfjvipon/bug/#3912/numbers-with-exponent
bug(#3912): translate capital `E` to `e`
2 parents ed3b721 + 61bc9d8 commit e184458

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

eo-parser/src/main/resources/org/eolang/parser/print/unhex-data.xsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2222
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2323
SOFTWARE.
2424
-->
25-
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:eo="https://www.eolang.org" id="unhex-data" version="2.0">
25+
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:eo="https://www.eolang.org" id="unhex-data" version="2.0">
2626
<!--
2727
Performs the reverse operation of "/org/eolang/parser/stars-to-tuples.xsl"
2828
-->
@@ -57,7 +57,7 @@ SOFTWARE.
5757
<xsl:otherwise>
5858
<xsl:copy>
5959
<xsl:apply-templates select="@*"/>
60-
<xsl:value-of select="eo:bytes-to-number($bytes)"/>
60+
<xsl:value-of select="translate(xs:string(eo:bytes-to-number($bytes)), 'E', 'e')"/>
6161
</xsl:copy>
6262
</xsl:otherwise>
6363
</xsl:choose>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2016-2025 Objectionary.com
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included
13+
# in all copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
---
23+
input: |
24+
# Hey.
25+
[] > foo
26+
4.294967295E9 > x
27+
sweet: |-
28+
{⟦
29+
foo ↦ ⟦
30+
x ↦ 4.294967295e9
31+
32+
⟧}
33+
salty: |-
34+
{
35+
36+
foo ↦ ⟦
37+
x ↦ Φ.org.eolang.number(
38+
α0 ↦ Φ.org.eolang.bytes(
39+
α0 ↦ ⟦ Δ ⤍ 41-EF-FF-FF-FF-E0-00-00 ⟧
40+
)
41+
)
42+
43+
44+
}

0 commit comments

Comments
 (0)