Skip to content

Commit

Permalink
Merge pull request #3821 from maxonfjvipon/bug/#3820/to-phi-removes-as
Browse files Browse the repository at this point in the history
bug(#3820): fixed ordering in to-phi
  • Loading branch information
yegor256 authored Jan 16, 2025
2 parents 25dd336 + 87de65d commit e3e8e2c
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ SOFTWARE.
</xsl:for-each>
</xsl:function>
<!-- CAN WE PRINT GIVEN STRING IN SINGLE LINE -->
<xsl:function name="eo:can-inline">
<xsl:function name="eo:can-inline" as="xs:boolean">
<xsl:param name="str"/>
<xsl:param name="extra"/>
<xsl:sequence select="not(contains($str, $new-line)) and string-length($str) + $extra &lt; 80"/>
Expand Down Expand Up @@ -246,7 +246,7 @@ SOFTWARE.
CHECKS IF APPLICATION ARGUMENTS IS RIGHT ORDER WITH ALPHAS, e.g.
α0 -> a, α1 -> b, ..., αN -> z
-->
<xsl:function name="eo:is-ordered">
<xsl:function name="eo:is-ordered" as="xs:boolean">
<xsl:param name="current"/>
<xsl:param name="position"/>
<xsl:variable name="current-pos" select="eo:element-binding($current, $position - 1)"/>
Expand Down Expand Up @@ -473,7 +473,7 @@ SOFTWARE.
<xsl:value-of select="$crb"/>
</xsl:if>
</xsl:template>
<!-- Nestd applied objects -->
<!-- Nested applied objects -->
<xsl:template match="o" mode="nested">
<xsl:param name="tabs"/>
<xsl:param name="after-start"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# The MIT License (MIT)
#
# Copyright (c) 2016-2025 Objectionary.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
---
input: |
+package com.example
class > app
5:version
method:init
42:0
"Hey":1
42:body
sweet: |-
{⟦
com ↦ ⟦
example ↦ ⟦
app ↦ Φ̇.class(
version ↦ 5,
init ↦ Φ̇.method(
α0 ↦ 42,
α1 ↦ "Hey",
body ↦ 42
)
),
λ ⤍ Package
⟧,
λ ⤍ Package
⟧}
salty: |-
{
com ↦ ⟦
example ↦ ⟦
app ↦ Φ.org.eolang.class(
version ↦ Φ.org.eolang.number(
α0 ↦ Φ.org.eolang.bytes(
α0 ↦ ⟦ Δ ⤍ 40-14-00-00-00-00-00-00 ⟧
)
),
init ↦ Φ.org.eolang.method(
α0 ↦ Φ.org.eolang.number(
α0 ↦ Φ.org.eolang.bytes(
α0 ↦ ⟦ Δ ⤍ 40-45-00-00-00-00-00-00 ⟧
)
),
α1 ↦ Φ.org.eolang.string(
α0 ↦ Φ.org.eolang.bytes(
α0 ↦ ⟦ Δ ⤍ 48-65-79 ⟧
)
),
body ↦ Φ.org.eolang.number(
α0 ↦ Φ.org.eolang.bytes(
α0 ↦ ⟦ Δ ⤍ 40-45-00-00-00-00-00-00 ⟧
)
)
)
),
λ ⤍ Package
⟧,
λ ⤍ Package
}

0 comments on commit e3e8e2c

Please sign in to comment.