Skip to content

Commit

Permalink
fix(#2866): merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Feb 12, 2024
2 parents d5dc874 + 29db835 commit cd072ce
Show file tree
Hide file tree
Showing 35 changed files with 254 additions and 182 deletions.
2 changes: 1 addition & 1 deletion eo-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ SOFTWARE.
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.16.0</version>
<version>1.16.1</version>
</dependency>
<dependency>
<groupId>org.twdata.maven</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,10 @@ SOFTWARE.
<xsl:template match="program">
<phi>
<xsl:text>{</xsl:text>
<xsl:variable name="tabs" select="1"/>
<xsl:value-of select="eo:eol($tabs)"/>
<xsl:variable name="tabs" select="2"/>
<xsl:value-of select="eo:eol(1)"/>
<xsl:value-of select="$lb"/>
<xsl:value-of select="eo:eol(2)"/>
<xsl:variable name="has-package" select="metas/meta/head[text()='package']"/>
<xsl:variable name="package" select="metas/meta[head[text()='package']]/tail[1]"/>
<xsl:variable name="parts" select="tokenize($package,'\.')"/>
Expand Down Expand Up @@ -215,6 +217,8 @@ SOFTWARE.
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="eo:eol(1)"/>
<xsl:value-of select="$rb"/>
<xsl:value-of select="eo:eol(0)"/>
<xsl:text>}</xsl:text>
</phi>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class UnphiMojoTest {
@Test
void createsFile(@TempDir final Path temp) throws Exception {
new HmBase(temp).save(
"{std ↦ Φ.org.eolang.io.stdout, y ↦ Φ.org.eolang.x}",
"{std ↦ Φ.org.eolang.io.stdout, y ↦ Φ.org.eolang.x}",
Paths.get("target/phi/std.phi")
);
MatcherAssert.assertThat(
Expand Down Expand Up @@ -93,14 +93,15 @@ void checksUnphiPacks(final String pack, @TempDir final Path temp) throws Except
new HmBase(temp).save(phi, Paths.get("target/phi/main.phi"));
final List<String> failures = new ListOf<>();
new FakeMaven(temp).execute(UnphiMojo.class);
final XML doc = new XMLDocument(
new TextOf(
temp.resolve(
Paths.get(String.format("target/%s/main.xmir", ParseMojo.DIR))
)
).asString()
);
for (final String xpath : (Iterable<String>) map.get("tests")) {
final List<XML> nodes = new XMLDocument(
new TextOf(
temp.resolve(
Paths.get(String.format("target/%s/main.xmir", ParseMojo.DIR))
)
).asString()
).nodes(xpath);
final List<XML> nodes = doc.nodes(xpath);
if (nodes.isEmpty()) {
failures.add(xpath);
}
Expand Down
22 changes: 12 additions & 10 deletions eo-maven-plugin/src/test/resources/org/eolang/maven/phi/as-phi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ eo: |
$.greater-than 0
phi: |
{
prints-itself ↦ ⟦
φ ↦ Φ.org.eolang.assert-that(
τ0 ↦ Φ.org.eolang.as-phi(
τ0 ↦ ξ
).length,
τ1 ↦ ξ.greater-than(
τ0 ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-00
prints-itself ↦ ⟦
φ ↦ Φ.org.eolang.assert-that(
α0 ↦ Φ.org.eolang.as-phi(
α0 ↦ ξ
).length,
α1 ↦ ξ.greater-than(
α0 ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-00
)
)
)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ eo: |
[] > inner /bytes
phi: |
{
main ↦ ⟦
λ ⤍ Lambda
⟧,
outer ↦ ⟦
inner ↦ ⟦
main ↦ ⟦
λ ⤍ Lambda
⟧,
outer ↦ ⟦
inner ↦ ⟦
λ ⤍ Lambda
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ eo: |
5:five
phi: |
{
xyz ↦ Φ.org.eolang.x(
attr ↦ Φ.org.eolang.y,
abs ↦ ⟦
z ↦ ∅,
φ ↦ Φ.org.eolang.w
⟧,
five ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-05
xyz ↦ Φ.org.eolang.x(
attr ↦ Φ.org.eolang.y,
abs ↦ ⟦
z ↦ ∅,
φ ↦ Φ.org.eolang.w
⟧,
five ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-05
)
)
)
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ eo: |
cage' a > y
phi: |
{
obj ↦ ⟦
x ↦ Φ.org.eolang.cage(),
y ↦ Φ.org.eolang.cage()(
τ0 ↦ Φ.org.eolang.a
)
obj ↦ ⟦
x ↦ Φ.org.eolang.cage(),
y ↦ Φ.org.eolang.cage()(
α0 ↦ Φ.org.eolang.a
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ eo: |
x y > z
phi: |
{
foo ↦ ⟦
bar ↦ ⟦
main ↦ ⟦
y ↦ ∅,
z ↦ Φ.com.yegor256.x(
τ0 ↦ ξ.y
)
foo ↦ ⟦
bar ↦ ⟦
main ↦ ⟦
y ↦ ∅,
z ↦ Φ.com.yegor256.x(
α0 ↦ ξ.y
)
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
eo: -- > empty
phi: |
{
empty ↦ Φ.org.eolang.bytes(
Δ ⤍ --
)
empty ↦ Φ.org.eolang.bytes(
Δ ⤍ --
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ eo: |
seq' > y
phi: |
{
main ↦ ⟦
z ↦ ∅,
x ↦ ⟦⟧,
y ↦ Φ.org.eolang.seq()
main ↦ ⟦
z ↦ ∅,
x ↦ ⟦⟧,
y ↦ Φ.org.eolang.seq()
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,41 +15,43 @@ eo: |
n.minus 2
phi: |
{
eo ↦ ⟦
example ↦ ⟦
fibonacci ↦ ⟦
n ↦ ∅,
φ ↦ ξ.n.lt(
τ0 ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-02
eo ↦ ⟦
example ↦ ⟦
fibonacci ↦ ⟦
n ↦ ∅,
φ ↦ ξ.n.lt(
α0 ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-02
)
)
)
).if(
τ0 ↦ ξ.n,
τ1 ↦ ξ.ρ.fibonacci(
τ0 ↦ ξ.n.minus(
τ0 ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-01
).if(
α0 ↦ ξ.n,
α1 ↦ ξ.ρ.fibonacci(
α0 ↦ ξ.n.minus(
α0 ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-01
)
)
)
)
).plus(
τ0 ↦ ξ.ρ.fibonacci(
τ0 ↦ ξ.n.minus(
τ0 ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-02
).plus(
α0 ↦ ξ.ρ.fibonacci(
α0 ↦ ξ.n.minus(
α0 ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-02
)
)
)
)
)
)
)
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ eo: |
Q.org.eolang.x > y
phi: |
{
std ↦ Φ.org.eolang.io.stdout,
y ↦ Φ.org.eolang.x
std ↦ Φ.org.eolang.io.stdout,
y ↦ Φ.org.eolang.x
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,35 @@ eo: |
"org/eolang/benchmark/F"
phi: |
{
org ↦ ⟦
eolang ↦ ⟦
benchmark ↦ ⟦
j$A ↦ ⟦
access ↦ Φ.org.eolang.int(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-20
)
),
supername ↦ Φ.org.eolang.string(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 6A-61-76-61-2F-6C-61-6E-67-2F-4F-62-6A-65-63-74
)
),
interfaces ↦ Φ.org.eolang.tuple(
τ0 ↦ Φ.org.eolang.tuple.empty,
τ1 ↦ Φ.org.eolang.string(
τ0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 6F-72-67-2F-65-6F-6C-61-6E-67-2F-62-65-6E-63-68-6D-61-72-6B-2F-46
org ↦ ⟦
eolang ↦ ⟦
benchmark ↦ ⟦
j$A ↦ ⟦
access ↦ Φ.org.eolang.int(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 00-00-00-00-00-00-00-20
)
),
supername ↦ Φ.org.eolang.string(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 6A-61-76-61-2F-6C-61-6E-67-2F-4F-62-6A-65-63-74
)
),
interfaces ↦ Φ.org.eolang.tuple(
α0 ↦ Φ.org.eolang.tuple.empty,
α1 ↦ Φ.org.eolang.string(
α0 ↦ Φ.org.eolang.bytes(
Δ ⤍ 6F-72-67-2F-65-6F-6C-61-6E-67-2F-62-65-6E-63-68-6D-61-72-6B-2F-46
)
)
)
)
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
⟧,
λ ⤍ Package
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
eo: x.y.z > xyz
phi: |
{
xyz ↦ Φ.org.eolang.x.y.z
xyz ↦ Φ.org.eolang.x.y.z
}

0 comments on commit cd072ce

Please sign in to comment.