From c0a0c3238e753ab6f2ea577414447a9b114be854 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 15 Jan 2025 17:40:10 +0300 Subject: [PATCH 1/5] bug(#3481): use --- .../org/eolang/maven/transpile/to-java.xsl | 76 ++++++++++++++----- .../maven/transpile-packs/embedded-class.yaml | 4 +- .../transpile-packs/long-class-name.yaml | 4 +- .../transpile-packs/tests-with-abstracts.yaml | 4 +- .../src/test/eo/org/eolang/runtime-tests.eo | 62 ++++++++++++++- 5 files changed, 122 insertions(+), 28 deletions(-) diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl index 046a8478e2..bb3b9b8c7a 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl @@ -152,6 +152,8 @@ SOFTWARE. + import java.util.function.Function; + import org.eolang.*; @@ -295,15 +297,21 @@ SOFTWARE. + Unnamed attribute found in - + + ((PhDefault) + + + ) + .add(" ", @@ -322,7 +330,15 @@ SOFTWARE. ") - + @@ -342,23 +358,29 @@ SOFTWARE. new AtOnce(new AtComposite( - , - - -> { + , new Function<>() { + @Override + + public Phi apply(final Phi + + ) { + Phi = new (); - + - + return ; + + } })) @@ -372,15 +394,19 @@ SOFTWARE. new AtOnce(new AtComposite( - , - - -> { + , new Function<>() { - PhDefault + @Override + + public Phi apply(final Phi + + ) { + + Phi = new PhDefault(); - + $ @@ -388,14 +414,16 @@ SOFTWARE. - - - - - + + + + + return ; + + } })) @@ -407,18 +435,24 @@ SOFTWARE. new AtOnce(new AtComposite( - , + , new Function<>() { + + @Override + + public Phi apply(final Phi - -> { + ) { - + - + return ; + + } })) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml index bec0381311..25b81fdcc1 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml @@ -28,8 +28,8 @@ sheets: asserts: - /program[not(errors)] - //java[contains(text(), 'this.add("xyz",')] - - //java[contains(text(), 'r.add("bar",')] - - //java[contains(text(), 'rr.add("φ",')] + - //java[contains(text(), '((PhDefault) r).add("bar",')] + - //java[contains(text(), '((PhDefault) rr).add("φ",')] - //java[contains(text(), 'Phi rrrbbb = new PhMethod(rrh, "ρ")')] - //java[contains(text(), 'Phi rrrbb = new PhMethod(rrrbbb, "ρ")')] - //java[contains(text(), 'Phi rrrb = new PhMethod(rrrbb, "this")')] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/long-class-name.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/long-class-name.yaml index 57f809d834..f15887f68d 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/long-class-name.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/long-class-name.yaml @@ -28,8 +28,8 @@ sheets: asserts: - /program[not(errors)] - //java[contains(text(), 'public final class EOtest extends PhDefault')] - - //java[contains(text(), 'PhDefault rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr = new PhDefault();')] - - //java[contains(text(), 'rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr.add("blah39"')] + - //java[contains(text(), 'Phi rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr = new PhDefault();')] + - //java[contains(text(), '((PhDefault) rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr).add("blah39"')] input: | # No comments. [] > test diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tests-with-abstracts.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tests-with-abstracts.yaml index 1676322bfc..402119ad23 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tests-with-abstracts.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tests-with-abstracts.yaml @@ -29,8 +29,8 @@ sheets: asserts: - /program[not(errors)] - /program/objects/class/java[contains(text(), 'this.add("b"')] - - /program/objects/class/java[contains(text(), 'r.add("c",')] - - /program/objects/class/java[contains(text(), 'rr.add("φ",')] + - /program/objects/class/java[contains(text(), '((PhDefault) r).add("c",')] + - /program/objects/class/java[contains(text(), '((PhDefault) rr).add("φ",')] - /program/objects/class/java[contains(text(), 'public void works() throws java.lang.Exception')] - /program/objects/class/java[contains(text(), 'private static class EOΦabcφα0')] - /program/objects/class/java[contains(text(), 'PhDefault r1 = new EOΦabcφα0boundα0();')] diff --git a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo index e514b1ea25..91c039fcac 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -383,4 +383,64 @@ true > global-test [] > blah8 blah9 > @ [] > blah9 - true > @ + blah10 > @ + [] > blah10 + blah11 > @ + [] > blah11 + blah12 > @ + [] > blah12 + blah13 > @ + [] > blah13 + blah14 > @ + [] > blah14 + blah15 > @ + [] > blah15 + blah16 > @ + [] > blah16 + blah17 > @ + [] > blah17 + blah18 > @ + [] > blah18 + blah19 > @ + [] > blah19 + blah20 > @ + [] > blah20 + blah21 > @ + [] > blah21 + blah22 > @ + [] > blah22 + blah23 > @ + [] > blah23 + blah24 > @ + [] > blah24 + blah25 > @ + [] > blah25 + blah26 > @ + [] > blah26 + blah27 > @ + [] > blah27 + blah28 > @ + [] > blah28 + blah29 > @ + [] > blah29 + blah30 > @ + [] > blah30 + blah31 > @ + [] > blah31 + blah32 > @ + [] > blah32 + blah33 > @ + [] > blah33 + blah34 > @ + [] > blah34 + blah35 > @ + [] > blah35 + blah36 > @ + [] > blah36 + blah37 > @ + [] > blah37 + blah38 > @ + [] > blah38 + blah39 > @ + [] > blah39 + true > @ From e9d62d765cbdd5fd47ff21f76b10cf7d144a8804 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 15 Jan 2025 18:04:21 +0300 Subject: [PATCH 2/5] bug(#3481): space --- eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java index 8cdc8f98dd..0d57964838 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java @@ -169,7 +169,7 @@ private static Func parse(final String name) { ).toString(); Logger.debug( ParseMojo.class, - "Parsed program %s:\n %s", + "Parsedprogram %s:\n %s", name, parsed ); From f002e550edecff6a6bd120ca9b7c25124f983d9b Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 15 Jan 2025 18:04:25 +0300 Subject: [PATCH 3/5] bug(#3481): back --- eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java index 0d57964838..8cdc8f98dd 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/ParseMojo.java @@ -169,7 +169,7 @@ private static Func parse(final String name) { ).toString(); Logger.debug( ParseMojo.class, - "Parsedprogram %s:\n %s", + "Parsed program %s:\n %s", name, parsed ); From dadc903093783cf4a8a63bcfe80f4ea6b7cebb30 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 15 Jan 2025 18:30:42 +0300 Subject: [PATCH 4/5] bug(#3481): ort --- .github/workflows/ort.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ort.yml b/.github/workflows/ort.yml index 08f04c27d0..429c2c1788 100644 --- a/.github/workflows/ort.yml +++ b/.github/workflows/ort.yml @@ -29,6 +29,7 @@ on: branches: - master jobs: + if: false ort: runs-on: ubuntu-24.04 steps: From 2bfc50d03a0a9c5d60a2343efbcef7618b663d40 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 15 Jan 2025 18:55:14 +0300 Subject: [PATCH 5/5] bug(#3481): ort false --- .github/workflows/ort.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ort.yml b/.github/workflows/ort.yml index 429c2c1788..d9c89b3e0f 100644 --- a/.github/workflows/ort.yml +++ b/.github/workflows/ort.yml @@ -29,8 +29,8 @@ on: branches: - master jobs: - if: false ort: + if: false runs-on: ubuntu-24.04 steps: - run: git config --global url.https://github.com/.insteadOf ssh://git@github.com/