From 25cd95f2d158b0eac4fc6789fc1a753500977297 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 16:16:42 +0300 Subject: [PATCH 01/58] #2896: Wait when the test fail --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index d28755dda2..67933c01bc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -35,8 +35,9 @@ import org.eolang.maven.log.CaptureLogs; import org.eolang.maven.log.Logs; import org.eolang.maven.util.HmBase; +import org.hamcrest.MatcherAssert; +import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; @@ -70,7 +71,6 @@ void doesNotFailWithNoErrorsAndWarnings(@TempDir final Path temp) { } @Test - @Disabled @CaptureLogs void detectsErrorsSuccessfully( @TempDir final Path temp, @@ -89,6 +89,11 @@ void detectsErrorsSuccessfully( "Program with noname attributes should have failed or error, but it didn't" ); final String message = this.getMessage(out, "Errors identified"); + MatcherAssert.assertThat( + "Errors message should have program name and error line number", + message, + Matchers.matchesPattern(this.createRegEx(temp, "Errors identified")) + ); Assertions.assertTrue( message.matches(this.createRegEx(temp, "Errors identified")), "Errors message should have program name and error line number" From 10b5ca66984a5b342229a0297951d78cad346df5 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 16:27:32 +0300 Subject: [PATCH 02/58] #2896: Does not throw exception --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 67933c01bc..40f8c5c4ae 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -104,7 +104,7 @@ void detectsErrorsSuccessfully( @CaptureLogs void detectsCriticalErrorsSuccessfully( @TempDir final Path temp, - final Logs out) throws Exception { + final Logs out) { Assertions.assertThrows( IllegalStateException.class, () -> new FakeMaven(temp) From 59dbf33a8be1b69718a9faa57d42ead16d4f99b2 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 16:41:09 +0300 Subject: [PATCH 03/58] #2896: Does not throw exception --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 40f8c5c4ae..67933c01bc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -104,7 +104,7 @@ void detectsErrorsSuccessfully( @CaptureLogs void detectsCriticalErrorsSuccessfully( @TempDir final Path temp, - final Logs out) { + final Logs out) throws Exception { Assertions.assertThrows( IllegalStateException.class, () -> new FakeMaven(temp) From fbce38abbe647c36d47124e3ac6d85d1d1cd166d Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 16:50:54 +0300 Subject: [PATCH 04/58] #2896: Does not throw exception --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 67933c01bc..40f8c5c4ae 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -104,7 +104,7 @@ void detectsErrorsSuccessfully( @CaptureLogs void detectsCriticalErrorsSuccessfully( @TempDir final Path temp, - final Logs out) throws Exception { + final Logs out) { Assertions.assertThrows( IllegalStateException.class, () -> new FakeMaven(temp) From e75f006ccb4bb10720e7079f4cab2c01cd402bb5 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 17:00:47 +0300 Subject: [PATCH 05/58] #2896: Does not throw exception --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 40f8c5c4ae..67933c01bc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -104,7 +104,7 @@ void detectsErrorsSuccessfully( @CaptureLogs void detectsCriticalErrorsSuccessfully( @TempDir final Path temp, - final Logs out) { + final Logs out) throws Exception { Assertions.assertThrows( IllegalStateException.class, () -> new FakeMaven(temp) From 9574fe1c6b805b5c8464ef138844fd71b05bc9ea Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 4 Mar 2024 17:19:34 +0300 Subject: [PATCH 06/58] #2896: Does not throw exception --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 67933c01bc..40f8c5c4ae 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -104,7 +104,7 @@ void detectsErrorsSuccessfully( @CaptureLogs void detectsCriticalErrorsSuccessfully( @TempDir final Path temp, - final Logs out) throws Exception { + final Logs out) { Assertions.assertThrows( IllegalStateException.class, () -> new FakeMaven(temp) From b3161eb7328cc9856573660cac971c4b985fe56f Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 15 Apr 2024 18:00:21 +0300 Subject: [PATCH 07/58] #2896: Filter by path --- .../java/org/eolang/maven/VerifyMojoTest.java | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index a9dc36139f..9bfb2e71a3 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -31,6 +31,8 @@ import com.yegor256.xsline.TrDefault; import com.yegor256.xsline.Xsline; import java.nio.file.Path; +import java.util.Arrays; + import org.cactoos.io.ResourceOf; import org.eolang.maven.log.CaptureLogs; import org.eolang.maven.log.Logs; @@ -51,11 +53,6 @@ * /org/eolang/parser/warnings/mandatory-version-meta.xsl and * /org/eolang/parser/warnings/mandatory-home-meta.xsl. * After you need fix {@code createRegEx()}. - * @todo #2890:30min Fix this {@link VerifyMojoTest#detectsErrorsSuccessfully} - * flaky test and enable it. It failed in ci - * here - * without providing the regex and message. Also may be it would be cleaner to fix - * error Assertion since now it is hard to get why it failed. */ @SuppressWarnings({"PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods"}) final class VerifyMojoTest { @@ -88,7 +85,9 @@ void detectsErrorsSuccessfully( .execute(new FakeMaven.Verify()), "Program with noname attributes should have failed or error, but it didn't" ); - final String message = this.getMessage(out, "Errors identified"); + System.out.println(temp.toString()); + final String message = this.getMessage(out, "Errors identified", temp.toString()); + System.out.println(message); MatcherAssert.assertThat( "Errors message should have program name and error line number", message, @@ -117,7 +116,7 @@ void detectsCriticalErrorsSuccessfully( .execute(new FakeMaven.Verify()), "Wrong program should have failed or error, but it didn't" ); - final String message = this.getMessage(out, "Critical error identified"); + final String message = this.getMessage(out, "Critical error identified", temp.toString()); Assertions.assertTrue( message.matches(this.createRegEx(temp, "Critical error identified")), "Critical error message should have program name and error line number" @@ -144,7 +143,7 @@ void detectsWarningWithCorrespondingFlag( .execute(new FakeMaven.Verify()), "Program with sparse decorated object should have failed on warning, but it didn't" ); - final String message = this.getMessage(out, "Warnings identified"); + final String message = this.getMessage(out, "Warnings identified", temp.toString()); Assertions.assertTrue( message.matches(this.createRegEx(temp, "Warnings identified")), "Warnings message should have program name and error line number" @@ -272,12 +271,12 @@ private static void applyXsl(final String xsl, final Path xml) throws Exception /** * Parse the error message to program name and error line number for checking. * @param logs Logs logs - * @param error String needed error message + * @param parts String needed error message */ - private String getMessage(final Logs logs, final String error) { + private String getMessage(final Logs logs, final String ... parts) { return String.valueOf(logs.captured().stream() .filter( - log -> log.contains(error) + log -> Arrays.stream(parts).allMatch(log::contains) ).findFirst() ); } From be964c44e73815f62c2e11ba1919c43077046b28 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 15 Apr 2024 18:00:31 +0300 Subject: [PATCH 08/58] #2896: Leaved todo --- .../src/test/java/org/eolang/maven/log/CaptureLogs.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java index b0dd4fe18f..e74ecdccf7 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java @@ -42,6 +42,9 @@ /** * Captured logs annotation for tests. + * @todo #2896:90min Logs should contains only messages related to + * the test. Now it appends all messages that were logged via Logger, + * so massages from other tests(in parallel) are included too. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) From f493abdbff1e004e773cfbdd52ac3baf9e5736ad Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 15 Apr 2024 18:04:29 +0300 Subject: [PATCH 09/58] #2896: Improved Assertion --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 9bfb2e71a3..3024e5d6f9 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -32,7 +32,6 @@ import com.yegor256.xsline.Xsline; import java.nio.file.Path; import java.util.Arrays; - import org.cactoos.io.ResourceOf; import org.eolang.maven.log.CaptureLogs; import org.eolang.maven.log.Logs; @@ -85,18 +84,12 @@ void detectsErrorsSuccessfully( .execute(new FakeMaven.Verify()), "Program with noname attributes should have failed or error, but it didn't" ); - System.out.println(temp.toString()); final String message = this.getMessage(out, "Errors identified", temp.toString()); - System.out.println(message); MatcherAssert.assertThat( "Errors message should have program name and error line number", message, Matchers.matchesPattern(this.createRegEx(temp, "Errors identified")) ); - Assertions.assertTrue( - message.matches(this.createRegEx(temp, "Errors identified")), - "Errors message should have program name and error line number" - ); } @Test From 1ac17d7b5ab5a0ef3ff4f430fe4693f31eb397b2 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 15 Apr 2024 18:09:19 +0300 Subject: [PATCH 10/58] #2896: Pqulice violation --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 3024e5d6f9..3d4949591c 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -266,7 +266,7 @@ private static void applyXsl(final String xsl, final Path xml) throws Exception * @param logs Logs logs * @param parts String needed error message */ - private String getMessage(final Logs logs, final String ... parts) { + private String getMessage(final Logs logs, final String... parts) { return String.valueOf(logs.captured().stream() .filter( log -> Arrays.stream(parts).allMatch(log::contains) From 512e3607fc22bcf1e435ae3f9265abe4df441031 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Tue, 16 Apr 2024 11:56:36 +0300 Subject: [PATCH 11/58] #2896: Edited todo --- .../src/test/java/org/eolang/maven/log/CaptureLogs.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java index e74ecdccf7..ba90d641fc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java @@ -42,9 +42,12 @@ /** * Captured logs annotation for tests. - * @todo #2896:90min Logs should contains only messages related to - * the test. Now it appends all messages that were logged via Logger, - * so massages from other tests(in parallel) are included too. + * @todo #2896:90min Make '@CaptureLogs' thread-safe. + * 'Logs' should contain only messages related to the test. + * Currently, '@CaptureLogs' appends all messages that + * were logged via 'Logger' to 'Logs', so messages from + * other tests (run in parallel) are also included, which causes + * problems when tests are run in parallel. */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.METHOD, ElementType.ANNOTATION_TYPE}) From 158643effb9e8d7fa7c487ed980deecc5235d959 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Tue, 16 Apr 2024 11:56:53 +0300 Subject: [PATCH 12/58] #2896: Inlined variable --- .../src/test/java/org/eolang/maven/VerifyMojoTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java index 3d4949591c..be094e11b8 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/VerifyMojoTest.java @@ -84,10 +84,9 @@ void detectsErrorsSuccessfully( .execute(new FakeMaven.Verify()), "Program with noname attributes should have failed or error, but it didn't" ); - final String message = this.getMessage(out, "Errors identified", temp.toString()); MatcherAssert.assertThat( "Errors message should have program name and error line number", - message, + this.getMessage(out, "Errors identified", temp.toString()), Matchers.matchesPattern(this.createRegEx(temp, "Errors identified")) ); } From a1575aab097cd8dd4fbba180b916950fa0c891f9 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Tue, 16 Apr 2024 12:03:04 +0300 Subject: [PATCH 13/58] #2896: Restart ci --- .../src/test/java/org/eolang/maven/log/CaptureLogs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java index ba90d641fc..8287f01113 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java @@ -61,7 +61,7 @@ * @since 0.30 */ final class CaptureLogsExtension implements - ParameterResolver, BeforeEachCallback, AfterEachCallback { + ParameterResolver, BeforeEachCallback, AfterEachCallback { /** * Logs. From 42bb26d4636ba0513d528bc3f853831b9fb21c5c Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Tue, 16 Apr 2024 12:03:13 +0300 Subject: [PATCH 14/58] #2896: Restart ci --- .../src/test/java/org/eolang/maven/log/CaptureLogs.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java index 8287f01113..ba90d641fc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/log/CaptureLogs.java @@ -61,7 +61,7 @@ * @since 0.30 */ final class CaptureLogsExtension implements - ParameterResolver, BeforeEachCallback, AfterEachCallback { + ParameterResolver, BeforeEachCallback, AfterEachCallback { /** * Logs. From 307689b8a5a55d98a6bf4f71d5bc4b9630367e85 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Sat, 27 Apr 2024 14:00:02 +0300 Subject: [PATCH 15/58] fix(#3147): no sigma in plugin and runtime --- .../java/org/eolang/maven/TranspileMojo.java | 1 - .../resources/org/eolang/maven/phi/to-phi.xsl | 17 +--- .../resources/org/eolang/maven/pre/attrs.xsl | 9 +- .../org/eolang/maven/pre/to-java.xsl | 70 ++++---------- .../org/eolang/maven/pre/varargs.xsl | 37 -------- ...nverts-to-java-with-arrays-and-scopes.yaml | 1 - .../org/eolang/maven/packs/pre/dot-home.yaml | 22 ----- .../maven/packs/pre/embedded-class.yaml | 2 +- .../synthetic-attributes-with-to-java.yaml | 1 - .../org/eolang/maven/phi/yaml/fibonaci.yaml | 4 +- .../maven/phi/yaml/iterates-over-counter.yaml | 4 +- .../org/eolang/maven/phi/yaml/nested.yaml | 8 +- .../org/eolang/maven/phi/yaml/specials.yaml | 2 - .../org/eolang/maven/unphi/bool-tests.yaml | 74 +++++++-------- .../org/eolang/maven/unphi/specials.yaml | 9 +- .../src/main/antlr4/org/eolang/parser/Eo.g4 | 4 - .../src/main/antlr4/org/eolang/parser/Phi.g4 | 4 - .../java/org/eolang/parser/XeEoListener.java | 2 - .../java/org/eolang/parser/XePhiListener.java | 2 - .../org/eolang/parser/packs/add-locators.yaml | 4 +- .../org/eolang/parser/packs/full-syntax.yaml | 2 - .../packs/syntax/bool-tests-straight.yaml | 74 +++++++-------- eo-runtime/src/main/eo/org/eolang/go.eo | 17 ++-- eo-runtime/src/main/eo/org/eolang/malloc.eo | 5 +- eo-runtime/src/main/eo/org/eolang/nan.eo | 10 +- .../main/eo/org/eolang/negative-infinity.eo | 16 ++-- .../main/eo/org/eolang/positive-infinity.eo | 16 ++-- .../main/java/EOorg/EOeolang/EOas_phi.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOand.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOconcat.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOeq.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOnot.java | 9 -- .../java/EOorg/EOeolang/EObytes$EOor.java | 6 +- .../java/EOorg/EOeolang/EObytes$EOright.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOsize.java | 9 -- .../java/EOorg/EOeolang/EObytes$EOslice.java | 5 +- .../java/EOorg/EOeolang/EObytes$EOxor.java | 5 +- .../EOeolang/EOcage$EOencaged$EOencage.java | 4 +- .../EOcage$EOencaged$EO\317\206.java" | 8 -- .../EOorg/EOeolang/EOcage$EO\317\206.java" | 10 +- .../main/java/EOorg/EOeolang/EOdataized.java | 4 +- .../src/main/java/EOorg/EOeolang/EOerror.java | 5 +- .../java/EOorg/EOeolang/EOfloat$EOdiv.java | 5 +- .../java/EOorg/EOeolang/EOfloat$EOgt.java | 5 +- .../java/EOorg/EOeolang/EOfloat$EOplus.java | 5 +- .../java/EOorg/EOeolang/EOfloat$EOtimes.java | 5 +- .../main/java/EOorg/EOeolang/EOint$EOdiv.java | 5 +- .../main/java/EOorg/EOeolang/EOint$EOgt.java | 5 +- .../java/EOorg/EOeolang/EOint$EOplus.java | 5 +- .../java/EOorg/EOeolang/EOint$EOtimes.java | 5 +- .../EOeolang/EOio/EOstdin$EOnext_line.java | 8 -- .../EOeolang/EOio/EOstdin$EO\317\206.java" | 8 -- .../java/EOorg/EOeolang/EOio/EOstdout.java | 9 +- .../main/java/EOorg/EOeolang/EOio/Input.java | 8 +- .../EOmalloc$EOof$EOallocated$EOread.java | 4 +- .../EOmalloc$EOof$EOallocated$EOwrite.java | 4 +- .../EOeolang/EOmalloc$EOof$EO\317\206.java" | 8 -- .../src/main/java/EOorg/EOeolang/EOrust.java | 4 +- .../src/main/java/EOorg/EOeolang/EOseq.java | 4 +- .../EOorg/EOeolang/EOstring$EOas_bytes.java | 9 -- .../EOorg/EOeolang/EOstring$EOlength.java | 9 -- .../java/EOorg/EOeolang/EOstring$EOslice.java | 5 +- .../src/main/java/EOorg/EOeolang/EOtry.java | 4 +- .../src/main/java/org/eolang/AtCopied.java | 52 ----------- .../src/main/java/org/eolang/AtFixed.java | 80 ---------------- .../src/main/java/org/eolang/AtRho.java | 13 --- .../src/main/java/org/eolang/AtSetRho.java | 5 +- eo-runtime/src/main/java/org/eolang/Attr.java | 5 - .../src/main/java/org/eolang/PhDefault.java | 22 +---- .../src/main/java/org/eolang/PhFake.java | 1 - .../src/main/java/org/eolang/PhPackage.java | 4 +- .../src/main/java/org/eolang/PhWrite.java | 4 - .../main/java/org/eolang/UniverseDefault.java | 3 - .../src/test/eo/org/eolang/runtime-tests.eo | 3 +- .../src/test/eo/org/eolang/rust-tests.eo | 20 ++-- .../java/EOorg/EOeolang/EOas_phiTest.java | 2 +- .../test/java/EOorg/EOeolang/EOcageTest.java | 14 ++- .../test/java/EOorg/EOeolang/EOerrorTest.java | 2 +- .../test/java/EOorg/EOeolang/EOintTest.java | 4 +- .../java/EOorg/EOeolang/EOio/EOstdinTest.java | 24 ++--- .../EOorg/EOeolang/EOio/EOstdoutTest.java | 14 +-- .../java/EOorg/EOeolang/EOmallocTest.java | 2 - .../test/java/EOorg/EOeolang/EOseqTest.java | 8 +- .../test/java/EOorg/EOeolang/EOtryTest.java | 42 ++++----- .../java/EOorg/EOeolang/EOtupleEOatTest.java | 22 +++-- .../test/java/org/eolang/DataizedTest.java | 15 +-- .../java/org/eolang/ExInterruptedTest.java | 6 +- .../src/test/java/org/eolang/PhDataTest.java | 15 +-- .../test/java/org/eolang/PhDefaultTest.java | 93 +++++-------------- .../test/java/org/eolang/PhLoggedTest.java | 4 +- .../test/java/org/eolang/PhMethodTest.java | 15 +-- .../src/test/java/org/eolang/PhWithTest.java | 18 ++-- .../java/org/eolang/UniverseDefaultTest.java | 19 ++-- 93 files changed, 307 insertions(+), 855 deletions(-) delete mode 100644 eo-maven-plugin/src/main/resources/org/eolang/maven/pre/varargs.xsl delete mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml delete mode 100644 eo-runtime/src/main/java/org/eolang/AtCopied.java delete mode 100644 eo-runtime/src/main/java/org/eolang/AtFixed.java diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java index 3e43565215..c1f71d0929 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java @@ -94,7 +94,6 @@ public final class TranspileMojo extends SafeMojo { "/org/eolang/maven/pre/tests.xsl", "/org/eolang/maven/pre/rename-tests-inners.xsl", "/org/eolang/maven/pre/attrs.xsl", - "/org/eolang/maven/pre/varargs.xsl", "/org/eolang/maven/pre/data.xsl" ).back(), new TrDefault<>( diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl index 74d978aec8..e2080ebc70 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl @@ -42,9 +42,6 @@ SOFTWARE. - - - @@ -105,14 +102,6 @@ SOFTWARE. . - - - - - - . - - @@ -245,14 +234,14 @@ SOFTWARE. - - + + . - + diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/attrs.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/attrs.xsl index 68b31ae918..3b68cf8593 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/attrs.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/attrs.xsl @@ -30,14 +30,7 @@ SOFTWARE. - - - formed - - - bound - - + bound void diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/to-java.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/to-java.xsl index f9fafcf169..5b8be0f7ef 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/to-java.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/to-java.xsl @@ -26,9 +26,16 @@ SOFTWARE. + + + ρ + + + φ + @@ -58,7 +65,7 @@ SOFTWARE. - + @@ -104,10 +111,10 @@ SOFTWARE. - φ + - ρ + @@ -191,19 +198,10 @@ SOFTWARE. () { - - public - - (final Phi sigma) { - - super(sigma); - public - (final Phi sigma) { - - super(sigma); + () { @@ -235,22 +233,6 @@ SOFTWARE. ") - - - new AtFormed(() -> { - - - - - - - - - - return ret; - - }) - new AtOnce( @@ -261,7 +243,6 @@ SOFTWARE. - return ret; @@ -286,7 +267,6 @@ SOFTWARE. - @@ -320,24 +300,21 @@ SOFTWARE. .copy() - + rho Phi.Φ - new PhMethod(rho, "ρ") - - - new PhMethod(rho, "σ") + new PhMethod(rho, " + + ") new - ( - - ) + () @@ -348,7 +325,9 @@ SOFTWARE. rho - , "σ") + , " + + ") , " @@ -368,7 +347,6 @@ SOFTWARE. - @@ -379,7 +357,6 @@ SOFTWARE. - @@ -388,7 +365,6 @@ SOFTWARE. - Phi @@ -399,10 +375,7 @@ SOFTWARE. - ρ - - - σ + @@ -418,7 +391,6 @@ SOFTWARE. - @@ -448,7 +420,6 @@ SOFTWARE. - @@ -470,7 +441,6 @@ SOFTWARE. - diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/varargs.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/varargs.xsl deleted file mode 100644 index fc69fec1fb..0000000000 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/pre/varargs.xsl +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml index 28b1fa7709..364071b6af 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml @@ -48,7 +48,6 @@ xsls: - /org/eolang/maven/pre/tests.xsl - /org/eolang/maven/pre/rename-tests-inners.xsl - /org/eolang/maven/pre/attrs.xsl - - /org/eolang/maven/pre/varargs.xsl - /org/eolang/maven/pre/data.xsl - /org/eolang/maven/pre/to-java.xsl tests: diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml deleted file mode 100644 index 63b686ed4f..0000000000 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -xsls: - - /org/eolang/parser/add-default-package.xsl - - /org/eolang/maven/pre/classes.xsl - - /org/eolang/maven/pre/attrs.xsl - - /org/eolang/maven/pre/data.xsl - - /org/eolang/maven/pre/to-java.xsl -tests: - - /program/errors[count(*)=0] - - //java/text()[not(contains(., '&'))] - -eo: | - # This is the default 64+ symbols comment in front of named abstract object. - [] > foo - 5 > five - a > @ - - # This is the default 64+ symbols comment in front of named abstract object. - [] > a - # This is the default 64+ symbols comment in front of named abstract object. - [] > @ - &.&.five > @ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml index 6fcb8f1040..80bfcb335e 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml @@ -15,7 +15,7 @@ xsls: - /org/eolang/maven/pre/to-java.xsl tests: - /program/errors[count(*)=0] - - //java[contains(text(), 'PhMethod(new PhMethod(rho, "σ"), "σ")')] + - //java[contains(text(), 'PhMethod(new PhMethod(rho, "ρ"), "ρ")')] eo: | # This is the default 64+ symbols comment in front of named abstract object. [x] > foo diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml index 652db1cb40..e3e9827b1d 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml @@ -48,7 +48,6 @@ xsls: - /org/eolang/maven/pre/tests.xsl - /org/eolang/maven/pre/rename-tests-inners.xsl - /org/eolang/maven/pre/attrs.xsl - - /org/eolang/maven/pre/varargs.xsl - /org/eolang/maven/pre/data.xsl - /org/eolang/maven/pre/to-java.xsl tests: diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/fibonaci.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/fibonaci.yaml index 3aad0adb69..f045ca769b 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/fibonaci.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/fibonaci.yaml @@ -29,7 +29,7 @@ phi: |- ) ).if( α0 ↦ ξ.n, - α1 ↦ ξ.σ.fibonacci( + α1 ↦ ξ.ρ.fibonacci( α0 ↦ ξ.n.minus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( @@ -38,7 +38,7 @@ phi: |- ) ) ).plus( - α0 ↦ ξ.σ.fibonacci( + α0 ↦ ξ.ρ.fibonacci( α0 ↦ ξ.n.minus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/iterates-over-counter.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/iterates-over-counter.yaml index 73746aa167..fb78820518 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/iterates-over-counter.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/iterates-over-counter.yaml @@ -47,8 +47,8 @@ phi: |- ).while( α0 ↦ ⟦ i ↦ ∅, - φ ↦ ξ.σ.x.write( - α0 ↦ ξ.σ.x.as-int.plus( + φ ↦ ξ.ρ.x.write( + α0 ↦ ξ.ρ.x.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/nested.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/nested.yaml index db7cbf10d7..0cc45c4cd7 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/nested.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/nested.yaml @@ -19,17 +19,17 @@ phi: |- a ↦ ∅, x ↦ ⟦ y ↦ ⟦ - d ↦ ξ.σ.σ.a, + d ↦ ξ.ρ.ρ.a, z ↦ ⟦ - five ↦ ξ.σ.σ.σ.σ.main( + five ↦ ξ.ρ.ρ.ρ.ρ.main( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-05 ) ) ), - b ↦ ξ.σ.σ.σ.a, - e ↦ ξ.σ.d + b ↦ ξ.ρ.ρ.ρ.a, + e ↦ ξ.ρ.d ⟧ ⟧ ⟧ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/specials.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/specials.yaml index a888b9afaa..3af42a0430 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/specials.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/specials.yaml @@ -3,7 +3,6 @@ eo: | # This is the default 64+ symbols comment in front of named abstract object. [] > main ^.x > x - y.& > h $.a > a @.@ > phi phi: |- @@ -11,7 +10,6 @@ phi: |- ⟦ main ↦ ⟦ x ↦ ξ.ρ.x, - h ↦ Φ.org.eolang.y.σ, a ↦ ξ.a, phi ↦ ξ.φ.φ ⟧ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/bool-tests.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/bool-tests.yaml index 08e9eeb341..54774d19c6 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/bool-tests.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/bool-tests.yaml @@ -92,8 +92,8 @@ phi: |- ).while( α0 ↦ ⟦ i ↦ ∅, - φ ↦ ξ.σ.x.write( - α0 ↦ ξ.σ.x.as-int.plus( + φ ↦ ξ.ρ.x.write( + α0 ↦ ξ.ρ.x.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -218,8 +218,8 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.m.write( - α0 ↦ ξ.σ.m.as-int.minus( + α1 ↦ ξ.ρ.m.write( + α0 ↦ ξ.ρ.m.as-int.minus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -268,8 +268,8 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.x.write( - α0 ↦ ξ.σ.x.as-int.plus( + α1 ↦ ξ.ρ.x.write( + α0 ↦ ξ.ρ.x.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -278,7 +278,7 @@ phi: |- ) ) ), - α1 ↦ ξ.σ.x.as-int + α1 ↦ ξ.ρ.x.as-int ) ) ⟧ @@ -311,8 +311,8 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.x.write( - α0 ↦ ξ.σ.x.as-int.plus( + α1 ↦ ξ.ρ.x.write( + α0 ↦ ξ.ρ.x.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -321,7 +321,7 @@ phi: |- ) ) ), - α1 ↦ ξ.σ.x + α1 ↦ ξ.ρ.x ) ) ⟧ @@ -415,16 +415,16 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.acc.write( - α0 ↦ ξ.σ.acc.as-int.plus( - α0 ↦ ξ.σ.arr.at( + α1 ↦ ξ.ρ.acc.write( + α0 ↦ ξ.ρ.acc.as-int.plus( + α0 ↦ ξ.ρ.arr.at( α0 ↦ ξ.i ) ) ) ), - α1 ↦ ξ.σ.iter.write( - α0 ↦ ξ.σ.iter.as-int.plus( + α1 ↦ ξ.ρ.iter.write( + α0 ↦ ξ.ρ.iter.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -526,16 +526,16 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.acc.write( - α0 ↦ ξ.σ.acc.as-int.plus( - α0 ↦ ξ.σ.arr.at( - α0 ↦ ξ.σ.iter.as-int + α1 ↦ ξ.ρ.acc.write( + α0 ↦ ξ.ρ.acc.as-int.plus( + α0 ↦ ξ.ρ.arr.at( + α0 ↦ ξ.ρ.iter.as-int ) ) ) ), - α1 ↦ ξ.σ.iter.write( - α0 ↦ ξ.σ.iter.as-int.plus( + α1 ↦ ξ.ρ.iter.write( + α0 ↦ ξ.ρ.iter.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -610,24 +610,24 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, α1 ↦ ⟦ - φ ↦ ξ.σ.iter.as-int.lt( - α0 ↦ ξ.σ.max + φ ↦ ξ.ρ.iter.as-int.lt( + α0 ↦ ξ.ρ.max ).if( α0 ↦ Φ.org.eolang.seq( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.acc.write( - α0 ↦ ξ.σ.acc.as-int.plus( - α0 ↦ ξ.σ.arr.at( - α0 ↦ ξ.σ.iter.as-int + α1 ↦ ξ.ρ.acc.write( + α0 ↦ ξ.ρ.acc.as-int.plus( + α0 ↦ ξ.ρ.arr.at( + α0 ↦ ξ.ρ.iter.as-int ) ) ) ), - α1 ↦ ξ.σ.iter.write( - α0 ↦ ξ.σ.iter.as-int.plus( + α1 ↦ ξ.ρ.iter.write( + α0 ↦ ξ.ρ.iter.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 @@ -688,24 +688,24 @@ phi: |- α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, α1 ↦ ⟦ - φ ↦ ξ.σ.iter.as-int.lt( - α0 ↦ ξ.σ.max + φ ↦ ξ.ρ.iter.as-int.lt( + α0 ↦ ξ.ρ.max ).if( α0 ↦ Φ.org.eolang.seq( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple( α0 ↦ Φ.org.eolang.tuple.empty, - α1 ↦ ξ.σ.acc.write( - α0 ↦ ξ.σ.acc.as-int.plus( - α0 ↦ ξ.σ.arr.at( - α0 ↦ ξ.σ.iter.as-int + α1 ↦ ξ.ρ.acc.write( + α0 ↦ ξ.ρ.acc.as-int.plus( + α0 ↦ ξ.ρ.arr.at( + α0 ↦ ξ.ρ.iter.as-int ) ) ) ), - α1 ↦ ξ.σ.iter.write( - α0 ↦ ξ.σ.iter.as-int.plus( + α1 ↦ ξ.ρ.iter.write( + α0 ↦ ξ.ρ.iter.as-int.plus( α0 ↦ Φ.org.eolang.int( α0 ↦ Φ.org.eolang.bytes( Δ ⤍ 00-00-00-00-00-00-00-01 diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/specials.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/specials.yaml index c6ab3ada0d..3b55a55936 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/specials.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/specials.yaml @@ -3,19 +3,12 @@ tests: - /program/objects/o[@name='main'] - /program/objects/o[@name='main']/o[@base='$']/following-sibling::o[@base='.^' and @method]/following-sibling::o[@base='.x' and @method and @name='x'] - - /program/objects/o[@name='main']/o[@base='Q'] - - /program/objects/o[@name='main']/o[@base='.org' and @method] - - /program/objects/o[@name='main']/o[@base='.eolang' and @method] - - /program/objects/o[@name='main']/o[@base='.y' and @method] - - /program/objects/o[@name='main']/o[@base='.&' and @method and @name='h'] - - /program/objects/o[@name='main']/o[@base='$']/following-sibling::o[@base='.a' and @method and @name='a'] - /program/objects/o[@name='main']/o[@base='$']/following-sibling::o[@base='.@' and @method]/following-sibling::o[@base='.@' and @method and @name='phi'] eo: | [] > main ^.x > x - y.& > h $.a > a @.@ > phi -phi: "{⟦main ↦ ⟦x ↦ ξ.ρ.x, h ↦ Φ.org.eolang.y.σ, a ↦ ξ.ρ.a, phi ↦ ξ.φ.φ⟧⟧}" +phi: "{⟦main ↦ ⟦x ↦ ξ.ρ.x, a ↦ ξ.ρ.a, phi ↦ ξ.φ.φ⟧⟧}" diff --git a/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 b/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 index b3299864a0..31a3c4f6d2 100644 --- a/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 +++ b/eo-parser/src/main/antlr4/org/eolang/parser/Eo.g4 @@ -489,7 +489,6 @@ finisher : NAME | PHI | RHO - | SIGMA ; // Beginner or finisher @@ -573,9 +572,6 @@ COLON ARROW : '>' ; -SIGMA - : '&' - ; XI : '$' ; PLUS: '+' diff --git a/eo-parser/src/main/antlr4/org/eolang/parser/Phi.g4 b/eo-parser/src/main/antlr4/org/eolang/parser/Phi.g4 index a19d294d19..1c85a78d29 100644 --- a/eo-parser/src/main/antlr4/org/eolang/parser/Phi.g4 +++ b/eo-parser/src/main/antlr4/org/eolang/parser/Phi.g4 @@ -43,7 +43,6 @@ alphaBinding attribute : PHI | RHO - | SIGMA | LABEL | alphaAttr ; @@ -116,9 +115,6 @@ PHI : 'φ' ; RHO : 'ρ' ; -SIGMA - : 'σ' - ; DELTA : 'Δ' ; diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index 69dd90b911..e7497fcada 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1089,8 +1089,6 @@ public void enterFinisher(final EoParser.FinisherContext ctx) { base = "@"; } else if (ctx.RHO() != null) { base = "^"; - } else if (ctx.SIGMA() != null) { - base = "&"; } else { base = ""; } diff --git a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java index 073e8965fc..ea3c19adb6 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java @@ -249,8 +249,6 @@ public void enterAttribute(final PhiParser.AttributeContext ctx) { attr = "@"; } else if (ctx.RHO() != null) { attr = "^"; - } else if (ctx.SIGMA() != null) { - attr = "&"; } else if (ctx.LABEL() != null) { attr = ctx.LABEL().getText(); } else if (ctx.alphaAttr() != null) { diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/add-locators.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/add-locators.yaml index ff859aa42d..09a4bc95ea 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/add-locators.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/add-locators.yaml @@ -15,7 +15,7 @@ tests: - //o[@base='e' and @loc='Φ.org.abc.tt.α2.φ.ρ'] - //o[@name='q' and @base='.p' and @loc='Φ.org.abc.q'] - //o[@base='.^' and not(@name) and @loc='Φ.org.abc.q.ρ'] - - //o[@base='.&' and not(@name) and @loc='Φ.org.abc.q.ρ.ρ'] + - //o[@base='.^' and not(@name) and @loc='Φ.org.abc.q.ρ.ρ'] - //o[@base='$' and not(@name) and @loc='Φ.org.abc.q.ρ.ρ.ρ'] eo: | +alias org.abc.foo.b @@ -38,4 +38,4 @@ eo: | [e] e.hello > @ - $.&.^.p > q + $.^.^.p > q diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/full-syntax.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/full-syntax.yaml index eecdacbd76..d92eccdf78 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/full-syntax.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/full-syntax.yaml @@ -11,7 +11,6 @@ tests: - //o[@as='i'] - //o[@as='1'] - //o[@as='0'] - - //o[@base='&'] - //o[@base='.five'] - //objects[not(.//o[@name=''])] - //o[@atom and @name='atom' and count(o)=2 and o[@name='a']] @@ -51,7 +50,6 @@ eo: | [] Q.x.f.d Q Q QQ.y QQ - &.@ > t ^.@.hey > you Q QQ diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/bool-tests-straight.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/bool-tests-straight.yaml index 2c4a17619c..5a53036bbf 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/bool-tests-straight.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/bool-tests-straight.yaml @@ -155,11 +155,11 @@ eo: | .while [i]:0 $ - .& + .^ .x .write > @ $ - .& + .^ .x .as-int .plus:0 @@ -386,11 +386,11 @@ eo: | .tuple .empty:0 $ - .& + .^ .m .write:1 $ - .& + .^ .m .as-int .minus:0 @@ -474,11 +474,11 @@ eo: | .tuple .empty:0 $ - .& + .^ .x .write:1 $ - .& + .^ .x .as-int .plus:0 @@ -492,7 +492,7 @@ eo: | .bytes:0 00-00-00-00-00-00-00-01 $ - .& + .^ .x .as-int:1 .eq > @ @@ -554,11 +554,11 @@ eo: | .tuple .empty:0 $ - .& + .^ .x .write:1 $ - .& + .^ .x .as-int .plus:0 @@ -572,7 +572,7 @@ eo: | .bytes:0 00-00-00-00-00-00-00-01 $ - .& + .^ .x:1 .eq > @ Q @@ -758,26 +758,26 @@ eo: | .tuple .empty:0 $ - .& + .^ .acc .write:1 $ - .& + .^ .acc .as-int .plus:0 $ - .& + .^ .arr .at:0 $ .i:0 $ - .& + .^ .iter .write:1 $ - .& + .^ .iter .as-int .plus:0 @@ -971,28 +971,28 @@ eo: | .tuple .empty:0 $ - .& + .^ .acc .write:1 $ - .& + .^ .acc .as-int .plus:0 $ - .& + .^ .arr .at:0 $ - .& + .^ .iter .as-int:0 $ - .& + .^ .iter .write:1 $ - .& + .^ .iter .as-int .plus:0 @@ -1129,12 +1129,12 @@ eo: | .empty:0 [] $ - .& + .^ .iter .as-int .lt $ - .& + .^ .max:0 .if > @ Q @@ -1159,28 +1159,28 @@ eo: | .tuple .empty:0 $ - .& + .^ .acc .write:1 $ - .& + .^ .acc .as-int .plus:0 $ - .& + .^ .arr .at:0 $ - .& + .^ .iter .as-int:0 $ - .& + .^ .iter .write:1 $ - .& + .^ .iter .as-int .plus:0 @@ -1292,12 +1292,12 @@ eo: | .empty:0 [] $ - .& + .^ .iter .as-int .lt $ - .& + .^ .max:0 .if > @ Q @@ -1322,28 +1322,28 @@ eo: | .tuple .empty:0 $ - .& + .^ .acc .write:1 $ - .& + .^ .acc .as-int .plus:0 $ - .& + .^ .arr .at:0 $ - .& + .^ .iter .as-int:0 $ - .& + .^ .iter .write:1 $ - .& + .^ .iter .as-int .plus:0 diff --git a/eo-runtime/src/main/eo/org/eolang/go.eo b/eo-runtime/src/main/eo/org/eolang/go.eo index 52058f0a35..44c1021740 100644 --- a/eo-runtime/src/main/eo/org/eolang/go.eo +++ b/eo-runtime/src/main/eo/org/eolang/go.eo @@ -62,9 +62,10 @@ [body] > to try > @ body token - [e] + # Exception. + [e] > ex if. > @ - &.^.id.eq e.id + ^.^.id.eq e.id e.value error e true @@ -73,13 +74,15 @@ [] > token # Backward jump. error > backward - [] - &.^.^.to &.^.body > value - &.^.^.id > id + # Next. + [] > next + ^.^.^.to ^.^.body > value + ^.^.^.id > id # Forward jump. [res] > forward error > @ - [] + # Next. + [] > next res > value - &.^.^.^.id > id + ^.^.^.^.id > id diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index 030274d3f1..01fcd0087a 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -74,9 +74,10 @@ # and the data are written into memory. [object scope] > for (dataized object).as-bytes > bts - &.of > @ + malloc.of > @ bts.size - [m] + # Outer scope. + [m] > outer-scope seq > @ * m.write 0 bts diff --git a/eo-runtime/src/main/eo/org/eolang/nan.eo b/eo-runtime/src/main/eo/org/eolang/nan.eo index 45f1e11db2..fb2a7ad971 100644 --- a/eo-runtime/src/main/eo/org/eolang/nan.eo +++ b/eo-runtime/src/main/eo/org/eolang/nan.eo @@ -52,20 +52,20 @@ # Multiplication of $ and x. [x] > times - & > @ + ^ > @ # Sum of $ and x. [x] > plus - & > @ + ^ > @ # Negation of $. [] > neg - & > @ + ^ > @ # Difference between $ and x. [x] > minus - & > @ + ^ > @ # Quotient of the division of $ by x. [x] > div - & > @ + ^ > @ diff --git a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo index 5ef9bf6572..d0ae6b1231 100644 --- a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo @@ -33,7 +33,7 @@ # Tests that $ = x. [x] > eq eq. > @ - &.as-bytes + ^.as-bytes x.as-bytes # Tests that $ < x. @@ -42,7 +42,7 @@ not. > @ or. value.eq nan.as-bytes - &.eq value + ^.eq value # Tests that $ ≤ x. [x] > lte @@ -57,7 +57,7 @@ # Tests that $ ≥ x. [x] > gte - &.eq x > @ + ^.eq x > @ # Multiplication of $ and x. [x] > times @@ -66,9 +66,8 @@ # Tests if given number is greater than float or integer zero. [num] > is-num-gt-zero try > @ - [] - 0.lt num > @ - [e] + 0.lt num + [e] > ex 0.0.lt num > @ false @@ -141,9 +140,8 @@ # Tests if given number is greater or equal to float or integer zero. [num] > is-num-gte-zero try > @ - [] - 0.lte num > @ - [e] + 0.lte num + [e] > ex 0.0.lte num > @ false if. > @ diff --git a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo index 8711d487f0..676ab1c3f5 100644 --- a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo @@ -33,7 +33,7 @@ # Tests that $ = x. [x] > eq eq. > @ - &.as-bytes + ^.as-bytes x.as-bytes # Tests that $ < x. @@ -42,7 +42,7 @@ # Tests that $ ≤ x. [x] > lte - &.eq x > @ + ^.eq x > @ # Tests that $ > x. [x] > gt @@ -50,7 +50,7 @@ not. > @ or. value.eq nan.as-bytes - &.eq value + ^.eq value # Tests that $ ≥ x. [x] > gte @@ -80,9 +80,8 @@ # Tests if given number is greater than float or integer zero. [num] > is-num-gt-zero try > @ - [] - 0.lt num > @ - [e] + 0.lt num + [e] > ex 0.0.lt num > @ false if. > @ @@ -142,9 +141,8 @@ # Tests if given number is greater or equal to float or integer zero. [num] > is-num-gte-zero try > @ - [] - 0.lte num > @ - [e] + 0.lte num + [e] > ex 0.0.lte num > @ false if. > @ diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOas_phi.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOas_phi.java index 81023e4a05..df3842d161 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOas_phi.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOas_phi.java @@ -44,13 +44,10 @@ @Versionized @XmirObject(oname = "as-phi") public final class EOas_phi extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOas_phi(final Phi sigma) { - super(sigma); + public EOas_phi() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java index 715dbe5e99..1efcd6ffa8 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOand.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "bytes.and") public final class EObytes$EOand extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOand(final Phi sigma) { - super(sigma); + public EObytes$EOand() { this.add("b", new AtVoid("b")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java index 9e57b36cf1..96eea4ac46 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOconcat.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "bytes.concat") public final class EObytes$EOconcat extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOconcat(final Phi sigma) { - super(sigma); + public EObytes$EOconcat() { this.add("b", new AtVoid("b")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java index f816e62c5b..afffa937f5 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOeq.java @@ -47,13 +47,10 @@ @Versionized @XmirObject(oname = "bytes.eq") public final class EObytes$EOeq extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOeq(final Phi sigma) { - super(sigma); + public EObytes$EOeq() { this.add("b", new AtVoid("b")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java index e6232138d6..4e80c203aa 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOnot.java @@ -44,15 +44,6 @@ @Versionized @XmirObject(oname = "bytes.not") public final class EObytes$EOnot extends PhDefault implements Atom { - - /** - * Ctor. - * @param sigma Sigma - */ - public EObytes$EOnot(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { return new Data.ToPhi( diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java index d0b14291d7..e8a87880ab 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOor.java @@ -45,14 +45,10 @@ @Versionized @XmirObject(oname = "bytes.or") public final class EObytes$EOor extends PhDefault implements Atom { - /** * Ctor. - * - * @param sigma Sigma */ - public EObytes$EOor(final Phi sigma) { - super(sigma); + public EObytes$EOor() { this.add("b", new AtVoid("b")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java index 9b7d5539aa..62a03e9fdd 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOright.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "bytes.right") public final class EObytes$EOright extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOright(final Phi sigma) { - super(sigma); + public EObytes$EOright() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java index b8523fc0f0..8f7ca3c8c0 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOsize.java @@ -44,15 +44,6 @@ @Versionized @XmirObject(oname = "bytes.size") public final class EObytes$EOsize extends PhDefault implements Atom { - - /** - * Ctor. - * @param sigma Sigma - */ - public EObytes$EOsize(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { return new Data.ToPhi((long) new Param(this).strong(byte[].class).length); diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java index 581ebbf233..60f216b8c2 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOslice.java @@ -46,13 +46,10 @@ @Versionized @XmirObject(oname = "bytes.slice") public final class EObytes$EOslice extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOslice(final Phi sigma) { - super(sigma); + public EObytes$EOslice() { this.add("start", new AtVoid("start")); this.add("len", new AtVoid("len")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java index e9363cb2c2..fe3f95d032 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EObytes$EOxor.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "bytes.xor") public final class EObytes$EOxor extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EObytes$EOxor(final Phi sigma) { - super(sigma); + public EObytes$EOxor() { this.add("b", new AtVoid("b")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EOencage.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EOencage.java index 53032e2f9a..c3c872a4b4 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EOencage.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EOencage.java @@ -47,10 +47,8 @@ final class EOcage$EOencaged$EOencage extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - EOcage$EOencaged$EOencage(final Phi sigma) { - super(sigma); + EOcage$EOencaged$EOencage() { this.add("object", new AtVoid("object")); } diff --git "a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EO\317\206.java" "b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EO\317\206.java" index cd24460b54..1386ac12dd 100644 --- "a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EO\317\206.java" +++ "b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EOencaged$EO\317\206.java" @@ -44,14 +44,6 @@ @Versionized @XmirObject(oname = "cage.encaged.@") final class EOcage$EOencaged$EOφ extends PhDefault implements Atom { - /** - * Ctor. - * @param sigma Sigma - */ - EOcage$EOencaged$EOφ(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() throws Exception { final int locator = Math.toIntExact( diff --git "a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EO\317\206.java" "b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EO\317\206.java" index 54b390702e..1041a3708a 100644 --- "a/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EO\317\206.java" +++ "b/eo-runtime/src/main/java/EOorg/EOeolang/EOcage$EO\317\206.java" @@ -43,17 +43,9 @@ @Versionized @XmirObject(oname = "cage.@") final class EOcage$EOφ extends PhDefault implements Atom { - /** - * Ctor. - * @param sigma Sigma - */ - EOcage$EOφ(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() throws Exception { - final Phi encaged = this.take(Attr.SIGMA).take("encaged").copy(); + final Phi encaged = this.take(Attr.RHO).take("encaged").copy(); encaged.put( "locator", new Data.ToPhi( diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOdataized.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOdataized.java index 3a4b31fabf..560c4a2656 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOdataized.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOdataized.java @@ -45,10 +45,8 @@ public final class EOdataized extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma. */ - public EOdataized(final Phi sigma) { - super(sigma); + public EOdataized() { this.add("target", new AtVoid("target")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java index 4bbdd6c41a..87f01e3432 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOerror.java @@ -52,13 +52,10 @@ @Versionized @XmirObject(oname = "error") public final class EOerror extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOerror(final Phi sigma) { - super(sigma); + public EOerror() { this.add("message", new AtVoid("message")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOdiv.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOdiv.java index 2a632dd36c..17edf0e690 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOdiv.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOdiv.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "float.div") public final class EOfloat$EOdiv extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOfloat$EOdiv(final Phi sigma) { - super(sigma); + public EOfloat$EOdiv() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOgt.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOgt.java index b4d2f23339..23c4efcc43 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOgt.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOgt.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "float.gt") public final class EOfloat$EOgt extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOfloat$EOgt(final Phi sigma) { - super(sigma); + public EOfloat$EOgt() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java index d03306732d..63a1515826 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOplus.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "float.plus") public final class EOfloat$EOplus extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOfloat$EOplus(final Phi sigma) { - super(sigma); + public EOfloat$EOplus() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOtimes.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOtimes.java index 2b0e6174ee..66869579bf 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOtimes.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOfloat$EOtimes.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "float.times") public final class EOfloat$EOtimes extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOfloat$EOtimes(final Phi sigma) { - super(sigma); + public EOfloat$EOtimes() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOdiv.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOdiv.java index 00c81758cb..659743741e 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOdiv.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOdiv.java @@ -46,13 +46,10 @@ @Versionized @XmirObject(oname = "int.div") public final class EOint$EOdiv extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOint$EOdiv(final Phi sigma) { - super(sigma); + public EOint$EOdiv() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOgt.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOgt.java index c3e20fdfcc..663bd3f63d 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOgt.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOgt.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "int.gt") public final class EOint$EOgt extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOint$EOgt(final Phi sigma) { - super(sigma); + public EOint$EOgt() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java index 6b4c166558..1e37e9290d 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOplus.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "int.plus") public final class EOint$EOplus extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOint$EOplus(final Phi sigma) { - super(sigma); + public EOint$EOplus() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOtimes.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOtimes.java index d466f89a2b..23a5cead54 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOtimes.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOint$EOtimes.java @@ -45,13 +45,10 @@ @Versionized @XmirObject(oname = "int.times") public final class EOint$EOtimes extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOint$EOtimes(final Phi sigma) { - super(sigma); + public EOint$EOtimes() { this.add("x", new AtVoid("x")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EOnext_line.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EOnext_line.java index fff1f984b7..bd77c68d0d 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EOnext_line.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EOnext_line.java @@ -43,14 +43,6 @@ */ @Versionized public final class EOstdin$EOnext_line extends PhDefault implements Atom { - /** - * Ctor. - * @param sigma Sigma - */ - public EOstdin$EOnext_line(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { try { diff --git "a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EO\317\206.java" "b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EO\317\206.java" index 808ade0fd8..881dd66ef5 100644 --- "a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EO\317\206.java" +++ "b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdin$EO\317\206.java" @@ -41,14 +41,6 @@ */ @Versionized public final class EOstdin$EOφ extends PhDefault implements Atom { - /** - * Ctor. - * @param sigma Sigma - */ - public EOstdin$EOφ(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { return new Data.ToPhi( diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdout.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdout.java index 85f5f37c6d..af67cecc7d 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdout.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/EOstdout.java @@ -58,19 +58,16 @@ public final class EOstdout extends PhDefault implements Atom { /** * Default ctor. - * @param sigma Sigma */ - public EOstdout(final Phi sigma) { - this(sigma, EOstdout.OUT); + public EOstdout() { + this(EOstdout.OUT); } /** * Ctor for the tests. - * @param sigma Sigma * @param out Stream to print */ - EOstdout(final Phi sigma, final PrintStream out) { - super(sigma); + EOstdout(final PrintStream out) { this.out = out; this.add("text", new AtVoid("text")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/Input.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/Input.java index 97a01b0eea..488f63c644 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOio/Input.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOio/Input.java @@ -39,7 +39,7 @@ * @since 0.28.0 */ @Versionized -public final class Input { +final class Input { /** * Default input. */ @@ -61,7 +61,7 @@ private Input() { * GetInstance. * @return The pointer to input */ - public static synchronized Input getInstance() { + static synchronized Input getInstance() { if (instance == null) { instance = new Input(); } @@ -72,7 +72,7 @@ public static synchronized Input getInstance() { * GetLine. * @return First read line from system input */ - public String getLine() { + String getLine() { this.scanner.useDelimiter(System.lineSeparator()); final String line = this.scanner.next(); this.scanner.reset(); @@ -83,7 +83,7 @@ public String getLine() { * GetAllLines. * @return All read lines from system input */ - public String getAllLines() { + String getAllLines() { final StringBuilder builder = new StringBuilder(); while (this.scanner.hasNextLine()) { builder.append(this.scanner.nextLine()).append(System.lineSeparator()); diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java index 5f9ff39c03..48c6e52f6f 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOread.java @@ -48,10 +48,8 @@ final class EOmalloc$EOof$EOallocated$EOread extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - EOmalloc$EOof$EOallocated$EOread(final Phi sigma) { - super(sigma); + EOmalloc$EOof$EOallocated$EOread() { this.add("offset", new AtVoid("offset")); this.add("length", new AtVoid("length")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java index ba97da96ad..7f029a2f5c 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EOallocated$EOwrite.java @@ -49,10 +49,8 @@ final class EOmalloc$EOof$EOallocated$EOwrite extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - EOmalloc$EOof$EOallocated$EOwrite(final Phi sigma) { - super(sigma); + EOmalloc$EOof$EOallocated$EOwrite() { this.add("offset", new AtVoid("offset")); this.add("data", new AtVoid("data")); } diff --git "a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EO\317\206.java" "b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EO\317\206.java" index 11a3844fec..094e056a70 100644 --- "a/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EO\317\206.java" +++ "b/eo-runtime/src/main/java/EOorg/EOeolang/EOmalloc$EOof$EO\317\206.java" @@ -45,14 +45,6 @@ @Versionized @XmirObject(oname = "malloc.of.@") final class EOmalloc$EOof$EOφ extends PhDefault implements Atom { - /** - * Ctor. - * @param sigma Sigma - */ - EOmalloc$EOof$EOφ(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { final Phi rho = this.take(Attr.RHO); diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java index 0b0d0743d2..09f8c6d529 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java @@ -128,10 +128,8 @@ public final class EOrust extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - public EOrust(final Phi sigma) { - super(sigma); + public EOrust() { this.add("code", new AtVoid("code")); this.add("portal", new AtVoid("portal")); this.add("params", new AtVoid("params")); diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOseq.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOseq.java index 73b3787250..5f9f763007 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOseq.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOseq.java @@ -48,10 +48,8 @@ public final class EOseq extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - public EOseq(final Phi sigma) { - super(sigma); + public EOseq() { this.add("steps", new AtVoid("steps")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOas_bytes.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOas_bytes.java index 5274c35425..cab9cde7df 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOas_bytes.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOas_bytes.java @@ -45,15 +45,6 @@ @Versionized @XmirObject(oname = "string.as-bytes") public final class EOstring$EOas_bytes extends PhDefault implements Atom { - - /** - * Ctor. - * @param sigma Sigma - */ - public EOstring$EOas_bytes(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { return new Data.ToPhi( diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOlength.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOlength.java index d912796c09..e9ed3a3a87 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOlength.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOlength.java @@ -44,15 +44,6 @@ @Versionized @XmirObject(oname = "string.length") public final class EOstring$EOlength extends PhDefault implements Atom { - - /** - * Ctor. - * @param sigma Sigma - */ - public EOstring$EOlength(final Phi sigma) { - super(sigma); - } - @Override public Phi lambda() { return new Data.ToPhi( diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOslice.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOslice.java index e8d28f7511..77a37fc60e 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOslice.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOstring$EOslice.java @@ -46,13 +46,10 @@ @Versionized @XmirObject(oname = "string.slice") public final class EOstring$EOslice extends PhDefault implements Atom { - /** * Ctor. - * @param sigma Sigma */ - public EOstring$EOslice(final Phi sigma) { - super(sigma); + public EOstring$EOslice() { this.add("start", new AtVoid("start")); this.add("len", new AtVoid("len")); } diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java index 9eab251e2c..6f447ce09e 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOtry.java @@ -49,10 +49,8 @@ public final class EOtry extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma */ - public EOtry(final Phi sigma) { - super(sigma); + public EOtry() { this.add("main", new AtVoid("main")); this.add("catch", new AtVoid("catch")); this.add("finally", new AtVoid("finally")); diff --git a/eo-runtime/src/main/java/org/eolang/AtCopied.java b/eo-runtime/src/main/java/org/eolang/AtCopied.java deleted file mode 100644 index 314178fa60..0000000000 --- a/eo-runtime/src/main/java/org/eolang/AtCopied.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2016-2024 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. - */ - -package org.eolang; - -/** - * Attribute that copies result object depends on the name of the attribute. - * @since 0.36.0 - */ -final class AtCopied extends AtEnvelope { - /** - * Ctor. - * @param attr Original attribute - * @param name Name of the object - */ - AtCopied(final Attr attr, final String name) { - super( - new AtGetOnly( - () -> { - final Phi ret; - if (!name.equals(Attr.RHO) && !name.equals(Attr.SIGMA)) { - ret = attr.get().copy(); - } else { - ret = attr.get(); - } - return ret; - } - ) - ); - } -} diff --git a/eo-runtime/src/main/java/org/eolang/AtFixed.java b/eo-runtime/src/main/java/org/eolang/AtFixed.java deleted file mode 100644 index 1e88aec4fc..0000000000 --- a/eo-runtime/src/main/java/org/eolang/AtFixed.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2016-2024 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. - */ - -package org.eolang; - -/** - * Attribute that ignores putting and copying. - * The only usage for the attribute is keeping \sigma - * attribute. - * - * @since 0.1 - */ -@Versionized -final class AtFixed implements Attr { - - /** - * Phi that is fixed. - */ - private final Phi fixed; - - /** - * Attribute. - */ - private final Attr attr; - - /** - * Ctor. - * @param phi Fixed phi - */ - AtFixed(final Phi phi) { - this.fixed = phi; - this.attr = new AtSimple(this.fixed); - } - - @Override - public String toString() { - return this.attr.toString(); - } - - @Override - public String φTerm() { - return this.attr.φTerm(); - } - - @Override - public Attr copy(final Phi self) { - return new AtFixed(this.fixed); - } - - @Override - public Phi get() { - return this.fixed; - } - - @Override - public boolean put(final Phi src) { - return false; - } -} diff --git a/eo-runtime/src/main/java/org/eolang/AtRho.java b/eo-runtime/src/main/java/org/eolang/AtRho.java index c8c3a027a7..9b60f972ad 100644 --- a/eo-runtime/src/main/java/org/eolang/AtRho.java +++ b/eo-runtime/src/main/java/org/eolang/AtRho.java @@ -29,19 +29,6 @@ /** * Special attribute for \rho. * The attribute can be set only once, and it ignores all other puts. - * When attribute is copied, the \rho inside isn't copied. - * It allows to have the same \rho if objects were copied recursively: - *

- * {@code - * [] > x - * [] > y - * x.y.^ # absent - * x' > x1 - * x1.y.^ # refers to x1 - * x1' > x2 - * x2.y.^ # refers to x1 - * } - *

* @since 0.36.0 */ final class AtRho implements Attr { diff --git a/eo-runtime/src/main/java/org/eolang/AtSetRho.java b/eo-runtime/src/main/java/org/eolang/AtSetRho.java index 86624e7ca8..96c2223081 100644 --- a/eo-runtime/src/main/java/org/eolang/AtSetRho.java +++ b/eo-runtime/src/main/java/org/eolang/AtSetRho.java @@ -26,8 +26,7 @@ /** * The attribute tries to copy object and set \rho to it. - * If the name of the attribute is {@link Attr#RHO} or {@link Attr#SIGMA} - just object is - * returned. + * If the name of the attribute is {@link Attr#RHO} - just object is returned. * * @since 0.36.0 */ @@ -53,7 +52,7 @@ final class AtSetRho extends AtEnvelope { new AtGetOnly( () -> { Phi ret = attr.get(); - if (!name.equals(Attr.RHO) && !name.equals(Attr.SIGMA)) { + if (!name.equals(Attr.RHO)) { final Phi copy = ret.copy(); if (copy.put(Attr.RHO, rho)) { ret = copy; diff --git a/eo-runtime/src/main/java/org/eolang/Attr.java b/eo-runtime/src/main/java/org/eolang/Attr.java index 7c240a7f61..6e2d9c18d1 100644 --- a/eo-runtime/src/main/java/org/eolang/Attr.java +++ b/eo-runtime/src/main/java/org/eolang/Attr.java @@ -51,11 +51,6 @@ public interface Attr extends Term { */ String RHO = "ρ"; - /** - * Sigma attribute. - */ - String SIGMA = "σ"; - /** * Make a copy of it. * diff --git a/eo-runtime/src/main/java/org/eolang/PhDefault.java b/eo-runtime/src/main/java/org/eolang/PhDefault.java index dc3d8a90d6..d356ff0020 100644 --- a/eo-runtime/src/main/java/org/eolang/PhDefault.java +++ b/eo-runtime/src/main/java/org/eolang/PhDefault.java @@ -24,7 +24,6 @@ package org.eolang; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; @@ -44,12 +43,11 @@ */ @Versionized @SuppressWarnings({"PMD.TooManyMethods", "PMD.ConstructorShouldDoInitialization"}) -public abstract class PhDefault implements Phi, Cloneable { - +public class PhDefault implements Phi, Cloneable { /** * Vertices. */ - protected static final Vertices VTX = new Vertices(); + private static final Vertices VTX = new Vertices(); /** * Logger. @@ -70,7 +68,7 @@ public abstract class PhDefault implements Phi, Cloneable { * Identity of it (the ID of the vertex). * @checkstyle VisibilityModifierCheck (2 lines) */ - protected int vertex; + private int vertex; /** * Data. @@ -96,23 +94,13 @@ public abstract class PhDefault implements Phi, Cloneable { /** * Ctor. */ - public PhDefault() { - this(Phi.Φ); - } - - /** - * Ctor. - * - * @param sigma Sigma - */ @SuppressWarnings("PMD.ConstructorOnlyInitializesOrCallOtherConstructors") - public PhDefault(final Phi sigma) { + public PhDefault() { this.vertex = PhDefault.VTX.next(); this.form = this.getClass().getName(); this.attrs = new HashMap<>(0); this.order = new HashMap<>(0); this.add(Attr.RHO, new AtRho()); - this.add(Attr.SIGMA, new AtFixed(sigma)); } @Override @@ -137,7 +125,7 @@ public int hashCode() { ); } for (final Map.Entry ent : this.attrs.entrySet().stream().filter( - e -> !Arrays.asList(Attr.RHO, Attr.SIGMA).contains(e.getKey()) + e -> !e.getKey().equals(Attr.RHO) ).collect(Collectors.toList())) { final String attr = String.format( format, diff --git a/eo-runtime/src/main/java/org/eolang/PhFake.java b/eo-runtime/src/main/java/org/eolang/PhFake.java index 49423fbcaf..d723824b5f 100644 --- a/eo-runtime/src/main/java/org/eolang/PhFake.java +++ b/eo-runtime/src/main/java/org/eolang/PhFake.java @@ -48,7 +48,6 @@ public PhFake() { * @param sup The function to return the real object */ public PhFake(final Supplier sup) { - super(Phi.Φ); this.add("args", new AtVoid("args")); this.add("φ", new AtComposite(this, rho -> sup.get())); } diff --git a/eo-runtime/src/main/java/org/eolang/PhPackage.java b/eo-runtime/src/main/java/org/eolang/PhPackage.java index c79d9c1e8b..6177f82c07 100644 --- a/eo-runtime/src/main/java/org/eolang/PhPackage.java +++ b/eo-runtime/src/main/java/org/eolang/PhPackage.java @@ -157,8 +157,8 @@ private Optional loadPhi(final String target) { try { res = Optional.of( (Phi) Class.forName(target) - .getConstructor(Phi.class) - .newInstance(Phi.Φ) + .getConstructor() + .newInstance() ); } catch (final ClassNotFoundException notfound) { res = Optional.empty(); diff --git a/eo-runtime/src/main/java/org/eolang/PhWrite.java b/eo-runtime/src/main/java/org/eolang/PhWrite.java index c4a28a18b1..7ce0cf81c6 100644 --- a/eo-runtime/src/main/java/org/eolang/PhWrite.java +++ b/eo-runtime/src/main/java/org/eolang/PhWrite.java @@ -32,7 +32,6 @@ /** * Object that writes other object to own \rho. - * (see {@link EOorg.EOeolang.EOcage$EOnew} and {@link EOorg.EOeolang.EOmemory$EOalloc}). * @since 0.36.0 */ public final class PhWrite extends PhDefault implements Atom { @@ -48,16 +47,13 @@ public final class PhWrite extends PhDefault implements Atom { /** * Ctor. - * @param sigma Sigma * @param attr Attribute name * @param ret Return value function */ public PhWrite( - final Phi sigma, final String attr, final Function ret ) { - super(sigma); this.attribute = attr; this.add(this.attribute, new AtVoid(this.attribute)); this.value = ret; diff --git a/eo-runtime/src/main/java/org/eolang/UniverseDefault.java b/eo-runtime/src/main/java/org/eolang/UniverseDefault.java index a6357087d6..6112ab9240 100644 --- a/eo-runtime/src/main/java/org/eolang/UniverseDefault.java +++ b/eo-runtime/src/main/java/org/eolang/UniverseDefault.java @@ -160,9 +160,6 @@ private static String replace(final String name) { case '@': builder.append(Attr.PHI); break; - case '&': - builder.append(Attr.SIGMA); - break; default: builder.append(cur); break; 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 808e9ad90c..4bc1be6d03 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -99,7 +99,8 @@ eq. > @ malloc.for 0 - [m] + # X. + [m] > x # A. [] > a seq > @ diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 32b159f0f6..ec920f36cc 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -134,7 +134,7 @@ pub fn foo(portal: &mut Portal) -> Option { Some( - EOInt(portal.find("$.&.a")? as i64) + EOInt(portal.find("$.^.a")? as i64) ) } """ @@ -155,7 +155,7 @@ use eo::eo_enum::EO::{EOVertex}; pub fn foo(portal: &mut Portal) -> Option { - let v = portal.find("$.&.book")?; + let v = portal.find("$.^.book")?; Some(EOVertex(v)) } """ @@ -224,8 +224,8 @@ use eo::eo_enum::EO::{EOInt}; pub fn foo(portal: &mut Portal) -> Option { - let v1 = portal.find("$.&.a")?; - let v2 = portal.find("$.&.b")?; + let v1 = portal.find("$.^.a")?; + let v2 = portal.find("$.^.b")?; portal.bind(v1 , v2, "EO-att")?; Some(EOInt(0 as i64)) } @@ -254,7 +254,7 @@ use eo::eo_enum::EO::{EOVertex}; pub fn foo(portal: &mut Portal) -> Option { - let v = portal.find("$.&.a")?; + let v = portal.find("$.^.a")?; let copy = portal.copy(v)?; Some(EOVertex(copy)) } @@ -275,7 +275,7 @@ use eo::eo_enum::EO::{EOInt}; pub fn foo(portal: &mut Portal) -> Option { - let v = portal.find("$.&.a")?; + let v = portal.find("$.^.a")?; let _bytes = portal.dataize(v)?; Some(EOInt(v as i64)) } @@ -299,11 +299,11 @@ use byteorder::{BigEndian, ReadBytesExt}; pub fn foo(portal: &mut Portal) -> Option { - let a = portal.find("$.&.a")?; + let a = portal.find("$.^.a")?; let bytes_a = portal.dataize(a)?; let a = bytes_a.as_slice().read_i64::().ok()?; - let b = portal.find("$.&.b")?; + let b = portal.find("$.^.b")?; let bytes_b = portal.dataize(b)?; let b = bytes_b.as_slice().read_i64::().ok()?; println!("sum 5 + 10 = {}", a + b); @@ -379,9 +379,9 @@ use eo::eo_enum::EO::{EOVertex}; pub fn foo(portal: &mut Portal) -> Option { - let eobook = portal.find("$.&.book")?; + let eobook = portal.find("$.^.book")?; let copy = portal.copy(eobook)?; - let eoline = portal.find("$.&.line")?; + let eoline = portal.find("$.^.line")?; portal.bind(copy.clone(), eoline, "content")?; Some(EOVertex(copy)) } diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOas_phiTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOas_phiTest.java index 0159ae1be2..1f6ab21951 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOas_phiTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOas_phiTest.java @@ -50,7 +50,7 @@ void printsAndReturns() { AtCompositeTest.TO_ADD_MESSAGE, new Dataized( new PhWith( - new EOas_phi(Phi.Φ), + new EOas_phi(), 0, new Data.ToPhi(1L) ) ).take(String.class), diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java index 72db6b68ec..a9bc7c6c8d 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java @@ -84,7 +84,7 @@ void encagesAndFrees() { void overwritesCagedObject() { final Phi cage = EOcageTest.encaged( new PhWith( - new EOcageTest.Dummy(Phi.Φ), + new EOcageTest.Dummy(), 0, new Data.ToPhi(1L) ) ); @@ -96,7 +96,7 @@ void overwritesCagedObject() { EOcageTest.encageTo( cage, new PhWith( - new EOcageTest.Dummy(Phi.Φ), + new EOcageTest.Dummy(), 0, new Data.ToPhi(2L) ) ); @@ -163,7 +163,7 @@ void doesNotWriteBoundedMethod() { @Test void writesBoundedCopyOfTheSameBase() { - final Phi dummy = new Dummy(Phi.Φ); + final Phi dummy = new Dummy(); Assertions.assertDoesNotThrow( () -> EOcageTest.encageTo( EOcageTest.encaged(dummy), @@ -259,9 +259,9 @@ void rewritesItselfToItselfViaDummy() { PhTraced.MAX_CAGE_RECURSION_DEPTH_PROPERTY_NAME, "2" ); final Phi cage = EOcageTest.encaged( - new PhWith(new EOcageTest.Dummy(Phi.Φ), 0, new Data.ToPhi(1L)) + new PhWith(new EOcageTest.Dummy(), 0, new Data.ToPhi(1L)) ); - EOcageTest.encageTo(cage, new PhWith(new EOcageTest.Dummy(Phi.Φ), 0, cage.copy())); + EOcageTest.encageTo(cage, new PhWith(new EOcageTest.Dummy(), 0, cage.copy())); Assertions.assertThrows( ExAbstract.class, () -> new Dataized( @@ -401,10 +401,8 @@ public Phi lambda() { private static final class Dummy extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Dummy(final Phi sigma) { - super(sigma); + Dummy() { this.add("x", new AtVoid("x")); } } diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java index 307fcf6b77..b25f9a880e 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOerrorTest.java @@ -59,7 +59,7 @@ void makesToxicObject() { EOerror.ExError.class, () -> new Dataized( new PhWith( - new EOerror(Phi.Φ), + new EOerror(), "message", new Data.ToPhi("intentional error") ) diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java index 62ce9f9625..35ce70ac89 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java @@ -55,7 +55,7 @@ void hasDifferentHashes() { @Test void hasHashEvenWithoutData() { - final Phi phi = new EOint(Phi.Φ); + final Phi phi = new EOint(); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, phi.hashCode(), @@ -65,7 +65,7 @@ void hasHashEvenWithoutData() { @Test void hasDifferentHash() { - final Phi raw = new EOint(Phi.Φ); + final Phi raw = new EOint(); final Phi initialized = new Data.ToPhi(0L); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdinTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdinTest.java index 872a869f74..1c2752d7c3 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdinTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdinTest.java @@ -88,7 +88,7 @@ void clearInput() { @Test void dataizesNextLineOneLine(final StdIn stdin) { final String expected = "this is a test input!"; - final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + final Phi phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); final String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -101,7 +101,7 @@ void dataizesNextLineOneLine(final StdIn stdin) { @Test void dataizesStdinOneLine(final StdIn stdin) { final String expected = "this is a testing input!".concat(System.lineSeparator()); - final Phi phi = new PhCopy(new EOstdin(Phi.Φ)); + final Phi phi = new PhCopy(new EOstdin()); final String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -114,7 +114,7 @@ void dataizesStdinOneLine(final StdIn stdin) { @Test void dataizesNextLineMultiLine(final StdIn stdin) { final String expected = "this is a test input!"; - final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + final Phi phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); final String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -126,7 +126,7 @@ void dataizesNextLineMultiLine(final StdIn stdin) { @StdIo("") @Test void dataizesNextLineEmpty(final StdIn stdin) { - final Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + final Phi phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); final EOerror.ExError error = Assertions.assertThrows( EOerror.ExError.class, () -> new Dataized(phi).take(String.class) @@ -145,7 +145,7 @@ void dataizesNextLineEmpty(final StdIn stdin) { void dataizesEmptyStdin(final StdIn stdin) { MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, - new Dataized(new EOstdin(Phi.Φ)).take(String.class), + new Dataized(new EOstdin()).take(String.class), Matchers.equalTo(System.lineSeparator()) ); } @@ -156,7 +156,7 @@ void dataizesStdinMultiLine(final StdIn stdin) { final String first = "this is a test input!".concat(System.lineSeparator()); final String second = "another line".concat(System.lineSeparator()); final String third = "yet another line".concat(System.lineSeparator()); - final Phi phi = new PhCopy(new EOstdin(Phi.Φ)); + final Phi phi = new PhCopy(new EOstdin()); final String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -171,21 +171,21 @@ void dataizesStdinFewOneLine(final StdIn stdin) { final String first = "\u0066\u0069\u0072\u0073\u0074"; final String second = "\u0073\u0065\u0063\u006F\u006E\u0064"; final String third = "\u0074\u0068\u0069\u0072\u0064"; - Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + Phi phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, actual, Matchers.equalTo(first) ); - phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, actual, Matchers.equalTo(second) ); - phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -199,21 +199,21 @@ void dataizesStdinFewOneLine(final StdIn stdin) { void dataizesStdinEmptyLineBetweenNonEmpty(final StdIn stdin) { final String first = "\u0066\u0069\u0072\u0073\u0074"; final String third = "\u0074\u0068\u0069\u0072\u0064"; - Phi phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + Phi phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); String actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, actual, Matchers.equalTo(first) ); - phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, actual, Matchers.equalTo("") ); - phi = new PhMethod(new PhCopy(new EOstdin(Phi.Φ)), "next-line"); + phi = new PhMethod(new PhCopy(new EOstdin()), "next-line"); actual = new Dataized(phi).take(String.class); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdoutTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdoutTest.java index 994c9f34d4..1c81e5bbe0 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdoutTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOio/EOstdoutTest.java @@ -63,7 +63,7 @@ public void printsFromTuple() { final ByteArrayOutputStream stream = new ByteArrayOutputStream(); final Phi ret = copy.take("at").copy(); ret.put(0, new Data.ToPhi(0L)); - final Phi stdout = new EOstdout(Phi.Φ, new PrintStream(stream)); + final Phi stdout = new EOstdout(new PrintStream(stream)); stdout.put(0, ret); new Dataized(stdout).take(Boolean.class); MatcherAssert.assertThat( @@ -77,7 +77,7 @@ public void printsFromTuple() { public void printsString() { final Phi format = new Data.ToPhi("Hello, world!\n"); final Phi phi = new PhWith( - new PhCopy(new EOstdout(Phi.Φ)), + new PhCopy(new EOstdout()), "text", format ); @@ -101,7 +101,7 @@ public void doesNotPrintTwiceOnIntComparisonMethods(final String method) { ), new Data.ToPhi(2L), new PhWith( - new EOstdout(Phi.Φ, new PrintStream(stream)), + new EOstdout(new PrintStream(stream)), "text", new Data.ToPhi(str) ) @@ -127,7 +127,7 @@ public void doesNotPrintTwiceOnFloatComparisonMethods(final String method) { ), new Data.ToPhi(3.0), new PhWith( - new EOstdout(Phi.Φ, new PrintStream(stream)), + new EOstdout(new PrintStream(stream)), "text", new Data.ToPhi(str) ) @@ -160,7 +160,7 @@ private static class PrintWithCmp extends PhDefault { * @param stdout Phi object with printing a string via {@link EOstdout} object */ PrintWithCmp(final Phi method, final Phi value, final Phi stdout) { - super(Phi.Φ); + super(); this.add( "φ", new AtOnce( @@ -172,11 +172,11 @@ private static class PrintWithCmp extends PhDefault { method, 0, new PhWith( - new EOseq(Phi.Φ), + new EOseq(), 0, new PhWith( new PhWith( - new EOtuple$EOempty(Phi.Φ) + new EOtuple$EOempty() .take("with") .copy(), 0, diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java index 223c1179e0..b2d9361d7f 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java @@ -108,7 +108,6 @@ private static class Dummy extends PhDefault { * Ctor. */ Dummy() { - super(Phi.Φ); this.add("m", new AtVoid("m")); this.add( Attr.PHI, @@ -139,7 +138,6 @@ private static class ErrorDummy extends PhDefault { * Ctor. */ ErrorDummy() { - super(Phi.Φ); this.add("m", new AtVoid("m")); this.add( Attr.PHI, diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOseqTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOseqTest.java index f3f10941cf..ed0958aafd 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOseqTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOseqTest.java @@ -49,11 +49,11 @@ public void calculatesAndReturns() { AtCompositeTest.TO_ADD_MESSAGE, new Dataized( new PhWith( - new EOseq(Phi.Φ), + new EOseq(), 0, new PhWith( new PhWith( - new EOtuple$EOempty(Phi.Φ).take("with").copy(), + new EOtuple$EOempty().take("with").copy(), 0, new Data.ToPhi(0L) ).take("with").copy(), 0, new Data.ToPhi(1L) @@ -70,11 +70,11 @@ public void calculatesAndReturnsObject() { AtCompositeTest.TO_ADD_MESSAGE, new Dataized( new PhWith( - new EOseq(Phi.Φ), + new EOseq(), 0, new PhWith( new PhWith( - new EOtuple$EOempty(Phi.Φ).take("with").copy(), + new EOtuple$EOempty().take("with").copy(), 0, new Data.ToPhi(0L) ).take("with").copy(), 0, new Data.ToPhi("Hello!") diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java index 0134635dea..d74a4c75f2 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOtryTest.java @@ -56,10 +56,10 @@ public void catchesException() { new PhWith( new PhWith( new PhWith( - new EOtry(Phi.Φ), - 0, new Broken(Phi.Φ) + new EOtry(), + 0, new Broken() ), - 1, new Catcher(Phi.Φ) + 1, new Catcher() ), 2, new Data.ToPhi(true) @@ -74,10 +74,10 @@ public void usesCatcherOutput() { final Phi body = new PhWith( new PhWith( new PhWith( - new EOtry(Phi.Φ), - 0, new Broken(Phi.Φ) + new EOtry(), + 0, new Broken() ), - 1, new Catcher(Phi.Φ) + 1, new Catcher() ), 2, new Data.ToPhi(true) @@ -94,10 +94,10 @@ public void printsCatcherOutput() { final Phi body = new PhWith( new PhWith( new PhWith( - new EOtry(Phi.Φ), - 0, new Broken(Phi.Φ) + new EOtry(), + 0, new Broken() ), - 1, new Catcher(Phi.Φ) + 1, new Catcher() ), 2, new Data.ToPhi(true) @@ -117,10 +117,10 @@ public void worksWithoutException() { new PhWith( new PhWith( new PhWith( - new EOtry(Phi.Φ), - 0, new Main(Phi.Φ) + new EOtry(), + 0, new Main() ), - 1, new Catcher(Phi.Φ) + 1, new Catcher() ), 2, new Data.ToPhi(true) @@ -132,10 +132,10 @@ public void worksWithoutException() { @Test public void doesNotDataizeBodyTwice() { - final Phi trier = new EOtry(Phi.Φ); + final Phi trier = new EOtry(); final MainWithCounter main = new MainWithCounter(); trier.put(0, main); - trier.put(1, new Catcher(Phi.Φ)); + trier.put(1, new Catcher()); trier.put(2, new Data.ToPhi(true)); new Dataized(trier).take(); MatcherAssert.assertThat( @@ -159,7 +159,7 @@ private static class MainWithCounter extends PhDefault { * Ctor. */ MainWithCounter() { - super(Phi.Φ); + super(); this.add( Attr.PHI, new AtComposite( @@ -181,10 +181,8 @@ private static class Main extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Main(final Phi sigma) { - super(sigma); + Main() { this.add( "φ", new AtComposite( @@ -204,10 +202,8 @@ private static class Main extends PhDefault { private static class Broken extends PhDefault { /** * Ctor. - * @param sigma Sigma. */ - Broken(final Phi sigma) { - super(sigma); + Broken() { this.add( "φ", new AtComposite( @@ -227,10 +223,8 @@ private static class Broken extends PhDefault { private static class Catcher extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Catcher(final Phi sigma) { - super(sigma); + Catcher() { this.add("ex", new AtVoid("ex")); this.add( "φ", diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java index dc1c9d5646..721fb2cb00 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java @@ -57,7 +57,7 @@ void pushesAndGetsBack() { final String txt = "Hello, world!"; final Phi str = new Data.ToPhi(txt); final Phi tuple = new PhWith( - new EOtuple$EOempty(Phi.Φ).take("with").copy(), + new EOtuple$EOempty().take("with").copy(), 0, str ); final Phi idx = new Data.ToPhi(0L); @@ -100,13 +100,13 @@ void checksOutOfBounds() { @Test void returnsGivenArgument() { - final Phi tuple = new EOtuple(Phi.Φ); + final Phi tuple = new EOtuple(); final Phi empty = tuple.take("empty"); final Phi copy = tuple.copy(); copy.put(0, empty); copy.put(1, new Data.ToPhi(10L)); final Phi phi = new PhWith( - new Parenting(Phi.Φ), + new Parenting(), "args", copy ); MatcherAssert.assertThat( @@ -121,7 +121,7 @@ private Phi get(final long index) { final String second = "second"; final Phi tuple = new PhWith( new PhWith( - new EOtuple$EOempty(Phi.Φ).take("with").copy(), + new EOtuple$EOempty().take("with").copy(), 0, new Data.ToPhi(first) ).take("with").copy(), 0, new Data.ToPhi(second) @@ -137,10 +137,12 @@ private Phi get(final long index) { * @since 0.36.0 */ private static class Parenting extends PhDefault { - Parenting(final Phi sigma) { - super(sigma); + /** + * Ctor. + */ + Parenting() { this.add("args", new AtVoid("args")); - this.add("take", new AtSimple(new Take(this))); + this.add("take", new AtSimple(new Take())); this.add( Attr.PHI, new AtOnce( @@ -155,8 +157,10 @@ private static class Parenting extends PhDefault { * @since 0.36.0 */ private static class Take extends PhDefault { - Take(final Phi sigma) { - super(sigma); + /** + * Ctor. + */ + Take() { this.add( Attr.PHI, new AtComposite( diff --git a/eo-runtime/src/test/java/org/eolang/DataizedTest.java b/eo-runtime/src/test/java/org/eolang/DataizedTest.java index b2f856968f..a993a3a39c 100644 --- a/eo-runtime/src/test/java/org/eolang/DataizedTest.java +++ b/eo-runtime/src/test/java/org/eolang/DataizedTest.java @@ -76,7 +76,7 @@ void logsWhenException() { final List logs = new LinkedList<>(); final Handler hnd = new Hnd(logs); log.addHandler(hnd); - final Phi wrong = new PhIncorrect(Phi.Φ); + final Phi wrong = new PhIncorrect(); IntStream.range(0, 5).forEach( i -> Assertions.assertThrows( IllegalStateException.class, @@ -109,7 +109,7 @@ void printsShortLogs() throws InterruptedException { () -> { final String property = System.getProperty("max.dataization.log"); System.getProperties().setProperty("max.dataization.log", String.valueOf(1)); - final Phi phi = new PhiDec(Phi.Φ); + final Phi phi = new PhiDec(); new Dataized(phi, log).take(); if (property != null) { System.getProperties().setProperty("max.dataization.log", property); @@ -140,7 +140,7 @@ void printsLongLogs() throws InterruptedException { () -> { final String property = System.getProperty("max.dataization.log"); System.getProperties().setProperty("max.dataization.log", String.valueOf(2)); - final Phi phi = new PhiDec(Phi.Φ); + final Phi phi = new PhiDec(); new Dataized(phi, log).take(); if (property != null) { System.getProperties().setProperty("max.dataization.log", property); @@ -167,10 +167,8 @@ private static class PhIncorrect extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - PhIncorrect(final Phi sigma) { - super(sigma); + PhIncorrect() { this.add( "Δ", new AtComposite( @@ -190,11 +188,8 @@ public static class PhiDec extends PhDefault { /** * Ctor. - * - * @param sigma Sigma */ - PhiDec(final Phi sigma) { - super(sigma); + PhiDec() { this.add( "φ", new AtOnce( diff --git a/eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java b/eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java index fd348efbf4..9866ac5444 100644 --- a/eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java +++ b/eo-runtime/src/test/java/org/eolang/ExInterruptedTest.java @@ -35,7 +35,7 @@ public class ExInterruptedTest { @Test void throwsRightException() { - final EOthrow phi = new EOthrow(new Data.ToPhi(true)); + final EOthrow phi = new EOthrow(); Assertions.assertThrows( ExInterrupted.class, () -> new Dataized(phi.take(Attr.PHI)).take(), @@ -51,10 +51,8 @@ void throwsRightException() { private static class EOthrow extends PhDefault { /** * CTor. - * @param sigma Sigma */ - EOthrow(final Phi sigma) { - super(sigma); + EOthrow() { this.add( "φ", new AtComposite( diff --git a/eo-runtime/src/test/java/org/eolang/PhDataTest.java b/eo-runtime/src/test/java/org/eolang/PhDataTest.java index 87553128ee..f2c1ad94fe 100644 --- a/eo-runtime/src/test/java/org/eolang/PhDataTest.java +++ b/eo-runtime/src/test/java/org/eolang/PhDataTest.java @@ -47,21 +47,8 @@ void returnsData() { final byte[] data = new byte[] {0x2A, 0x3B}; MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, - new PhData(new Dummy(), data).delta(), + new PhData(new PhDefault(), data).delta(), Matchers.equalTo(data) ); } - - /** - * Dummy. - * @since 0.36.0 - */ - private static final class Dummy extends PhDefault { - /** - * Ctor. - */ - Dummy() { - super(Phi.Φ); - } - } } diff --git a/eo-runtime/src/test/java/org/eolang/PhDefaultTest.java b/eo-runtime/src/test/java/org/eolang/PhDefaultTest.java index 2eb315b5a8..20f49471f0 100644 --- a/eo-runtime/src/test/java/org/eolang/PhDefaultTest.java +++ b/eo-runtime/src/test/java/org/eolang/PhDefaultTest.java @@ -209,17 +209,6 @@ void doesNotCopyRhoWhileDispatch() { ); } - @Test - void doesNotCopySigmaWhileDispatch() { - final Phi phi = new PhDefaultTest.Int(); - final Phi plus = phi.take("plus"); - MatcherAssert.assertThat( - String.format("%s attributes should not be copied while dispatch", Attr.SIGMA), - plus.take(Attr.SIGMA), - Matchers.equalTo(plus.take(Attr.SIGMA)) - ); - } - @Test void copiesUnsetVoidAttribute() { final Phi phi = new PhDefaultTest.Int(); @@ -345,7 +334,7 @@ void copiesWithSetData() { @Test void setsVoidAttributeOnlyOnce() { final Phi num = new Data.ToPhi(42L); - final Phi phi = new PhDefaultTest.Foo(Phi.Φ); + final Phi phi = new PhDefaultTest.Foo(); phi.put(0, num); Assertions.assertThrows( ExReadOnly.class, @@ -356,7 +345,7 @@ void setsVoidAttributeOnlyOnce() { @Test void printsEndlessRecursionObject() { - final Phi phi = new PhDefaultTest.EndlessRecursion(Phi.Φ); + final Phi phi = new PhDefaultTest.EndlessRecursion(); PhDefaultTest.EndlessRecursion.count = 2; MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -367,7 +356,7 @@ void printsEndlessRecursionObject() { @Test void cachesPhiRecursively() { - final Phi phi = new PhDefaultTest.RecursivePhi(Phi.Φ); + final Phi phi = new PhDefaultTest.RecursivePhi(); PhDefaultTest.RecursivePhi.count = 3; MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -378,7 +367,7 @@ void cachesPhiRecursively() { @Test void cachesPhiViaNewRecursively() { - final Phi phi = new PhDefaultTest.RecursivePhiViaNew(Phi.Φ); + final Phi phi = new PhDefaultTest.RecursivePhiViaNew(); PhDefaultTest.RecursivePhiViaNew.count = 3; MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -389,7 +378,7 @@ void cachesPhiViaNewRecursively() { @Test void refersToOriginalObjectAndDoesNotResetCache() { - final Phi phi = new PhDefaultTest.Dummy(Phi.Φ); + final Phi phi = new PhDefaultTest.Dummy(); phi.take("plus"); final Phi copy = phi.copy(); copy.take("plus"); @@ -403,7 +392,7 @@ void refersToOriginalObjectAndDoesNotResetCache() { @Test void doesNotReadMultipleTimes() { - final Phi phi = new PhDefaultTest.Counter(Phi.Φ); + final Phi phi = new PhDefaultTest.Counter(); final long total = 2L; for (long idx = 0L; idx < total; ++idx) { new Dataized(phi).take(); @@ -467,7 +456,7 @@ void doesNotCalculateRandomTwice() { new PhMethod( new PhWith( new PhMethod( - new Rnd(Phi.Φ), "plus" + new Rnd(), "plus" ), 0, new Data.ToPhi(1.2) ), @@ -498,10 +487,8 @@ void injectsDeltaIntoTerm() { private static class Rnd extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Rnd(final Phi sigma) { - super(sigma); + Rnd() { this.add( "φ", new AtComposite( @@ -523,9 +510,8 @@ private static class Int extends PhDefault { * Ctor. */ Int() { - super(Phi.Φ); this.add("void", new AtVoid("void")); - this.add("plus", new AtSimple(new Plus(this))); + this.add("plus", new AtSimple(new PhDefault())); this.add( Attr.PHI, new AtOnce( @@ -551,20 +537,6 @@ private static class Int extends PhDefault { } } - /** - * Plus. - * @since 0.36.0 - */ - private static class Plus extends PhDefault { - /** - * Ctor. - * @param sigma Sigma - */ - Plus(final Phi sigma) { - super(sigma); - } - } - /** * Foo. * @since 1.0 @@ -572,22 +544,11 @@ private static class Plus extends PhDefault { public static class Foo extends PhDefault { /** * Ctor. - * @param sigma Sigma - */ - Foo(final Phi sigma) { - this(sigma, 5L); - } - - /** - * Ctor. - * @param sigma Sigma - * @param data Data */ - Foo(final Phi sigma, final Object data) { - super(sigma); + Foo() { this.add("x", new AtVoid("x")); - this.add("kid", new AtSimple(new PhDefaultTest.Kid(this))); - this.add("φ", new AtSimple(new Data.ToPhi(data))); + this.add("kid", new AtSimple(new PhDefaultTest.Kid())); + this.add("φ", new AtSimple(new Data.ToPhi(5L))); } } @@ -603,10 +564,8 @@ public static class Dummy extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Dummy(final Phi sigma) { - super(sigma); + Dummy() { this.add( Attr.PHI, new AtFormed( @@ -631,10 +590,8 @@ public static class Counter extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Counter(final Phi sigma) { - super(sigma); + Counter() { this.add( Attr.PHI, new AtFormed( @@ -655,12 +612,10 @@ public static class Counter extends PhDefault { public static class Kid extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Kid(final Phi sigma) { - super(sigma); + Kid() { this.add("z", new AtVoid("z")); - this.add(Attr.PHI, new AtSimple(new EOstdout(Phi.Φ))); + this.add(Attr.PHI, new AtSimple(new EOstdout())); } } @@ -676,10 +631,8 @@ public static class EndlessRecursion extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - EndlessRecursion(final Phi sigma) { - super(sigma); + EndlessRecursion() { this.add( Attr.PHI, new AtComposite( @@ -690,7 +643,7 @@ public static class EndlessRecursion extends PhDefault { if (PhDefaultTest.EndlessRecursion.count <= 0) { result = new Data.ToPhi(0L); } else { - result = new PhCopy(new PhDefaultTest.EndlessRecursion(self)); + result = new PhCopy(new PhDefaultTest.EndlessRecursion()); } return result; } @@ -711,10 +664,8 @@ public static class RecursivePhi extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - RecursivePhi(final Phi sigma) { - super(sigma); + RecursivePhi() { this.add( "φ", new AtComposite( @@ -746,10 +697,8 @@ public static class RecursivePhiViaNew extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - RecursivePhiViaNew(final Phi sigma) { - super(sigma); + RecursivePhiViaNew() { this.add( "φ", new AtFormed( @@ -761,7 +710,7 @@ public static class RecursivePhiViaNew extends PhDefault { } else { result = new Data.ToPhi( new Dataized( - new RecursivePhiViaNew(Phi.Φ) + new RecursivePhiViaNew() ).take(Long.class) ); } diff --git a/eo-runtime/src/test/java/org/eolang/PhLoggedTest.java b/eo-runtime/src/test/java/org/eolang/PhLoggedTest.java index 47b3d04c39..43caffb7af 100644 --- a/eo-runtime/src/test/java/org/eolang/PhLoggedTest.java +++ b/eo-runtime/src/test/java/org/eolang/PhLoggedTest.java @@ -98,10 +98,8 @@ void convertsToString() { private static final class Dummy extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - private Dummy(final Phi sigma) { - super(sigma); + private Dummy() { this.add("x", new AtVoid("x")); } } diff --git a/eo-runtime/src/test/java/org/eolang/PhMethodTest.java b/eo-runtime/src/test/java/org/eolang/PhMethodTest.java index 80f0baf8b7..fd128f4727 100644 --- a/eo-runtime/src/test/java/org/eolang/PhMethodTest.java +++ b/eo-runtime/src/test/java/org/eolang/PhMethodTest.java @@ -55,7 +55,7 @@ void convertsSafeToString() { @Test void calculatesPhiJustOnce() { - final Dummy dummy = new Dummy(Phi.Φ); + final Dummy dummy = new Dummy(); final Phi phi = new PhMethod(dummy, "φ"); final int total = 10; for (int idx = 0; idx < total; ++idx) { @@ -70,7 +70,7 @@ void calculatesPhiJustOnce() { @Test void calculatesLocalJustOnce() { - final Dummy dummy = new Dummy(Phi.Φ); + final Dummy dummy = new Dummy(); final Phi phi = new PhMethod(dummy, "foo"); final int total = 10; for (int idx = 0; idx < total; ++idx) { @@ -85,7 +85,7 @@ void calculatesLocalJustOnce() { @Test void calculatesPhiOnce() { - final Dummy dummy = new Dummy(Phi.Φ); + final Dummy dummy = new Dummy(); final Phi phi = new PhMethod(dummy, "neg"); new Dataized(phi).take(); MatcherAssert.assertThat( @@ -123,15 +123,6 @@ public static class Dummy extends PhDefault { * Ctor. */ Dummy() { - this(Phi.Φ); - } - - /** - * Ctor. - * @param sigma Sigma - */ - Dummy(final Phi sigma) { - super(sigma); this.add( "φ", new AtOnce( diff --git a/eo-runtime/src/test/java/org/eolang/PhWithTest.java b/eo-runtime/src/test/java/org/eolang/PhWithTest.java index 9cf283fb94..40ee2f7398 100644 --- a/eo-runtime/src/test/java/org/eolang/PhWithTest.java +++ b/eo-runtime/src/test/java/org/eolang/PhWithTest.java @@ -41,7 +41,7 @@ final class PhWithTest { @Test void comparesTwoObjects() { final Phi dummy = new PhWith( - new PhMethod(new PhWithTest.Dummy(Phi.Φ), "plus"), + new PhMethod(new PhWithTest.Dummy(), "plus"), 0, new Data.ToPhi(1L) ); MatcherAssert.assertThat( @@ -63,7 +63,7 @@ void takesMethod() { @Test void passesToSubObject() { - final Phi dummy = new PhWithTest.Dummy(Phi.Φ); + final Phi dummy = new PhWithTest.Dummy(); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, new Dataized( @@ -78,7 +78,7 @@ void passesToSubObject() { @Test void printsToString() { - final Phi dummy = new PhWithTest.Dummy(Phi.Φ); + final Phi dummy = new PhWithTest.Dummy(); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, new PhWith( @@ -93,7 +93,7 @@ void printsToString() { @ValueSource(strings = {"hello", "bye", "", "привет"}) void runsInThreads(final String data) { final String attr = "foo"; - final Phi ref = new PhWith(new DummyWithAtFree(attr, Phi.Φ), 0, new Data.ToPhi(data)); + final Phi ref = new PhWith(new DummyWithAtFree(attr), 0, new Data.ToPhi(data)); final Func actual = phi -> { MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -114,7 +114,7 @@ void runsInThreads(final String data) { @Test void hasTheSameFormaWithBoundAttribute() { - final Phi dummy = new DummyWithAtFree("x", Phi.Φ); + final Phi dummy = new DummyWithAtFree("x"); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, dummy.forma(), @@ -133,10 +133,8 @@ private static class DummyWithAtFree extends PhDefault { /** * Ctor. * @param attr Free attribute name - * @param sigma Sigma */ - DummyWithAtFree(final String attr, final Phi sigma) { - super(sigma); + DummyWithAtFree(final String attr) { this.add(attr, new AtVoid(attr)); } } @@ -149,10 +147,8 @@ public static class Dummy extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - Dummy(final Phi sigma) { - super(sigma); + Dummy() { this.add("φ", new AtComposite(this, self -> new Data.ToPhi(1L))); } } diff --git a/eo-runtime/src/test/java/org/eolang/UniverseDefaultTest.java b/eo-runtime/src/test/java/org/eolang/UniverseDefaultTest.java index b99a30353d..b97d9a77b5 100644 --- a/eo-runtime/src/test/java/org/eolang/UniverseDefaultTest.java +++ b/eo-runtime/src/test/java/org/eolang/UniverseDefaultTest.java @@ -71,7 +71,7 @@ void findsSimpleAtt() { @Test void findsLongAtt() { - final Phi phi = new DummyWithStructure(Phi.Φ); + final Phi phi = new DummyWithStructure(); final UniverseDefault universe = new UniverseDefault(phi); MatcherAssert.assertThat( AtCompositeTest.TO_ADD_MESSAGE, @@ -107,7 +107,7 @@ void throwsIfWrongFind() { Assertions.assertThrows( ExAbstract.class, () -> new UniverseDefault( - new DummyWithStructure(Phi.Φ) + new DummyWithStructure() ).find("$.wrong-name"), AtCompositeTest.TO_ADD_MESSAGE ); @@ -133,7 +133,7 @@ void throwsIfWrongDataize() { Assertions.assertThrows( ExAbstract.class, () -> new UniverseDefault( - new DummyWithStructure(Phi.Φ) + new DummyWithStructure() ).dataize(-1), AtCompositeTest.TO_ADD_MESSAGE ); @@ -178,7 +178,7 @@ void putsToCopy() { @Test void bindsCopyToAbstract() { - final Phi dummy = new DummyAbstract(Phi.Φ); + final Phi dummy = new DummyAbstract(); final Map indexed = new MapOf<>(dummy.hashCode(), dummy); final Universe universe = new UniverseDefault(dummy, indexed); final int eobytes = universe.find("Q.org.eolang.bytes"); @@ -207,10 +207,9 @@ private static class DummyWithAt extends PhDefault { * @param sigma Sigma. */ DummyWithAt(final Phi sigma) { - super(sigma); this.add( UniverseDefaultTest.ABSTRACT_ATT, - new AtComposite(sigma, self -> new EOint(Phi.Φ)) + new AtComposite(sigma, self -> new EOint()) ); this.add( UniverseDefaultTest.VALUE_ATT, @@ -227,10 +226,8 @@ private static class DummyWithStructure extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - DummyWithStructure(final Phi sigma) { - super(sigma); + DummyWithStructure() { this.add(UniverseDefaultTest.ABSTRACT_ATT, new AtComposite(this, DummyWithAt::new)); } } @@ -243,10 +240,8 @@ private static class DummyAbstract extends PhDefault { /** * Ctor. - * @param sigma Sigma */ - DummyAbstract(final Phi sigma) { - super(sigma); + DummyAbstract() { this.add( UniverseDefaultTest.ABSTRACT_ATT, new AtVoid(UniverseDefaultTest.ABSTRACT_ATT) From 451162bddd6a1086a8226c36a59e4afd061d19c7 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Sun, 28 Apr 2024 12:36:43 +0300 Subject: [PATCH 16/58] #3139: Added postfix --- .../src/main/java/org/eolang/maven/rust/Names.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java index ab362fbdd4..c37b17bb7b 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java @@ -52,7 +52,7 @@ public final class Names { /** * Prefix for the names. */ - public static final String PREFIX = "native"; + public static final String PREFIX = "NATIVE"; /** * Target directory. @@ -95,9 +95,10 @@ public String name(final String loc) { return cached.computeIfAbsent( loc, key -> String.format( - "%s%d", + "%s%dx%s", Names.PREFIX, - cached.size() + cached.size(), + Names.trim(key) ) ); } @@ -145,6 +146,13 @@ public void save() throws IOException { ); } + private static String trim(final String loc) { + final String[] split = {loc}; + final String replaced = split[split.length-1] + .replaceAll("[^a-zA-Z0-9.-]", "").toUpperCase().replaceAll("[. -]", "x"); + return replaced.substring(Math.max(replaced.length() - 16, 0)); + } + /** * Prestructor to initialize this.all. * @param dest Directory where to load from. From fac6e1f14477834571ad8aa3dbbe78f4a70dd1b6 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Sun, 28 Apr 2024 20:15:52 +0300 Subject: [PATCH 17/58] #3139: Assigns human-readable names to rust files --- .../java/org/eolang/maven/rust/Names.java | 17 +++++++---- .../org/eolang/maven/rust/PrimeModule.java | 30 ++++++++++++++++++- .../org/eolang/maven/BinarizeMojoTest.java | 6 ++-- .../org/eolang/maven/BinarizeParseTest.java | 14 ++++----- .../eolang/maven/rust/PrimeModuleTest.java | 6 ++-- .../org/eolang/maven/rust/RustNodeTest.java | 6 ++-- .../src/test/eo/org/eolang/rust-tests.eo | 18 +++++++++++ 7 files changed, 74 insertions(+), 23 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java index c37b17bb7b..36509b6b02 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/Names.java @@ -52,7 +52,7 @@ public final class Names { /** * Prefix for the names. */ - public static final String PREFIX = "NATIVE"; + public static final String PREFIX = "native"; /** * Target directory. @@ -95,7 +95,7 @@ public String name(final String loc) { return cached.computeIfAbsent( loc, key -> String.format( - "%s%dx%s", + "%s%d_%s", Names.PREFIX, cached.size(), Names.trim(key) @@ -146,11 +146,16 @@ public void save() throws IOException { ); } + /** + * Format loc: Remove non-ascii symbols, replace Φ.org.eolang with QQ + * and limit length of name characters. + * @param loc Locator of Rust insert. + * @return Formatted name. + */ private static String trim(final String loc) { - final String[] split = {loc}; - final String replaced = split[split.length-1] - .replaceAll("[^a-zA-Z0-9.-]", "").toUpperCase().replaceAll("[. -]", "x"); - return replaced.substring(Math.max(replaced.length() - 16, 0)); + final String replaced = loc.replace("Φ.org.eolang", "QQ") + .replaceAll("[^a-zA-Z0-9.-]", "").replaceAll("[. -]", "_"); + return replaced.substring(Math.max(replaced.length() - 64, 0)); } /** diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java index 5522d12bbf..402ff7d349 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java @@ -47,7 +47,7 @@ public PrimeModule(final String method, final String file) { "use eo::eo_enum::EO::EOError;", "#[no_mangle]", "pub extern \"system\" fn", - String.format("Java_EOrust_natives_%s_%s", method, method), + translate(method), "<'local> (env: JNIEnv<'local>, _class: JClass<'local>, universe: JObject<'local>) -> JByteArray<'local>", "{ let mut eo = Portal::new(env, _class, universe); ", "let arr = foo(&mut eo)", @@ -58,4 +58,32 @@ public PrimeModule(final String method, final String file) { file ); } + + /** + * Translates ("mangles") Java method name to native method name. + * @param jname Name of this function (and class) in Java. + * @return How it named in Rust. + */ + private static String translate(final String jname) { + return PrimeModule.translate( + "EOrust.natives.".concat(jname), + jname + ); + } + + /** + * Translates ("mangles") Java method name to native method name according to + * documentation + * or stackoverflow. + * @param clazz Simple name of class. + * @param method Name of method. + * @return How it named in Rust. + */ + private static String translate(final String clazz, final String method) { + return String.format( + "Java_%s_%s", + clazz.replace("_", "_1").replace(".", "_"), + method.replace("_", "_1") + ); + } } diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java index 1f99afb893..01677fa01b 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java @@ -160,19 +160,19 @@ void doesNotRecompile(@TempDir final Path temp) throws IOException { } maven.execute(new FakeMaven.Binarize()); final File executable = cache - .resolve("Lib/native0/target/debug/") + .resolve("Lib/native0_QQ_custom_creates_object_r_0/target/debug/") .resolve(RustNode.LIB) .toFile(); final long first = executable.lastModified(); maven.execute(new FakeMaven.Binarize()); final long second = executable.lastModified(); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "Check that file exists", first, Matchers.not(0L) ); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "The cached program should not be recompiled", second, Matchers.equalTo(first) ); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java index cabac1dc77..47487208bf 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java @@ -65,7 +65,7 @@ void parsesSimpleEoProgram(@TempDir final Path temp) throws Exception { BinarizeMojoTest.SRC.resolve("simple-rust.eo") ); final String function = String.format( - "%s0", + "%s0_QQ_custom_creates_object_r_0", Names.PREFIX ); final String rust = String.format( @@ -73,11 +73,11 @@ void parsesSimpleEoProgram(@TempDir final Path temp) throws Exception { function ); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "The program exists", res, Matchers.hasKey(rust) ); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "Correct content of Rust file", new TextOf(res.get(rust)).asString(), Matchers.stringContainsInOrder( "use rand::Rng;", @@ -90,7 +90,7 @@ void parsesSimpleEoProgram(@TempDir final Path temp) throws Exception { ) ); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "Correct content of Java file", new TextOf( res.get( String.format( @@ -110,11 +110,11 @@ void binarizesTwiceRustProgram(@TempDir final Path temp) throws Exception { BinarizeMojoTest.SRC.resolve("twice-rust.eo") ); final String one = String.format( - "target/Lib/%s0/src/foo.rs", + "target/Lib/%s0_QQ_custom_hello_world_1_r_0/src/foo.rs", Names.PREFIX ); final String two = String.format( - "target/Lib/%s1/src/foo.rs", + "target/Lib/%s1_QQ_custom_hello_world_2_r_0/src/foo.rs", Names.PREFIX ); MatcherAssert.assertThat( @@ -165,7 +165,7 @@ void createsCorrectRustProject(@TempDir final Path temp) throws Exception { BinarizeMojoTest.SRC.resolve("twice-rust.eo") ); final String dir = String.format( - "target/Lib/%s1/", + "target/Lib/%s1_QQ_custom_hello_world_2_r_0/", Names.PREFIX ); final String cargo = dir.concat("Cargo.toml"); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java index b7b64fa897..ab6889c48d 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java @@ -34,7 +34,7 @@ import org.junit.jupiter.api.io.TempDir; /** - * Test case for {@link Module}. + * Test case for {@link PrimeModule}. * * @since 0.1 */ @@ -45,12 +45,12 @@ void savesCorrectly(@TempDir final Path temp) throws Exception { final String name = "name"; new PrimeModule(method, name).save(new FtDefault(temp)); MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "Check that PrimeModule is saved correctly", new TextOf( temp.resolve(Paths.get(name.concat(".rs"))) ).asString(), Matchers.stringContainsInOrder( - String.format("Java_EOrust_natives_%s_%s", method, method), + "Java_EOrust_natives_my_1method_my_1method", "<'local> (env: JNIEnv<'local>, _class: JClass<'local>, universe: JObject<'local>) -> JByteArray" ) ); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/RustNodeTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/RustNodeTest.java index 8ce4c40aae..ddc0066c01 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/RustNodeTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/RustNodeTest.java @@ -61,9 +61,9 @@ void generatesRust(@TempDir final Path temp) throws IOException { "Check that necessary files are created", out, Matchers.hasItems( - lib.resolve("native0/src/foo.rs"), - lib.resolve("native0/src/lib.rs"), - gen.resolve("native0.java") + lib.resolve("native0_QQ_custom_rust_r_0/src/foo.rs"), + lib.resolve("native0_QQ_custom_rust_r_0/src/lib.rs"), + gen.resolve("native0_QQ_custom_rust_r_0.java") ) ); } diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 32b159f0f6..fa6ac13668 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -25,6 +25,24 @@ +package org.eolang +version 0.0.0 +# Works with long names correctly. +[] > rust-long-variable + QQ.rust > very-looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong + """ + use eo::Portal; + use eo::eo_enum::EO; + use eo::eo_enum::EO::{EOInt}; + + pub fn foo(_portal: &mut Portal) -> Option { + Some(EOInt(0)) + } + """ + [] + * + eq. > @ + very-looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong + 0 + # Test [] > rust-returns-positive-int QQ.rust > r From 491bad09e3473119c170be38fb9b664504e5d49f Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Sun, 28 Apr 2024 20:22:05 +0300 Subject: [PATCH 18/58] #3139: Removed unused import --- .../src/test/java/org/eolang/maven/rust/PrimeModuleTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java index ab6889c48d..f4735e7e9d 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/rust/PrimeModuleTest.java @@ -26,7 +26,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.cactoos.text.TextOf; -import org.eolang.maven.BinarizeParseTest; import org.eolang.maven.footprint.FtDefault; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; From 973b61244ce70bd9bdecfc9b2a2dde326ef044aa Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 29 Apr 2024 13:10:50 +0300 Subject: [PATCH 19/58] #3139: Added example --- .../src/main/java/org/eolang/maven/rust/PrimeModule.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java index 402ff7d349..1f592e289e 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/rust/PrimeModule.java @@ -61,6 +61,9 @@ public PrimeModule(final String method, final String file) { /** * Translates ("mangles") Java method name to native method name. + * For example, translated "native0_custom" to + * Java_EOrust_natives_native0_1custom_native0_1custom. + * See {@link PrimeModule#translate(String, String)} for motivation. * @param jname Name of this function (and class) in Java. * @return How it named in Rust. */ From 66f20b9673f3996d97619d3a52371b2ed27310f8 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 29 Apr 2024 13:30:35 +0300 Subject: [PATCH 20/58] #3139: restart ci --- .../main/java/org/eolang/maven/hash/CommitHashesText.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java index 1e3465021c..90e0dc073e 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java @@ -29,6 +29,7 @@ import org.cactoos.Text; import org.cactoos.scalar.Unchecked; import org.cactoos.text.Sticky; +import org.cactoos.text.Synced; import org.cactoos.text.TextEnvelope; import org.cactoos.text.TextOf; @@ -49,8 +50,10 @@ final class CommitHashesText extends TextEnvelope { /** * Cache. */ - private static final Text CACHE = new Sticky( - CommitHashesText.asText(CommitHashesText.HOME) + private static final Text CACHE = new Synced( + new Sticky( + CommitHashesText.asText(CommitHashesText.HOME) + ) ); /** From f5187269212c5c97a82a5f8d60440285d3409865 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 29 Apr 2024 13:30:57 +0300 Subject: [PATCH 21/58] #3139: restart ci --- .../main/java/org/eolang/maven/hash/CommitHashesText.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java index 90e0dc073e..1e3465021c 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java @@ -29,7 +29,6 @@ import org.cactoos.Text; import org.cactoos.scalar.Unchecked; import org.cactoos.text.Sticky; -import org.cactoos.text.Synced; import org.cactoos.text.TextEnvelope; import org.cactoos.text.TextOf; @@ -50,10 +49,8 @@ final class CommitHashesText extends TextEnvelope { /** * Cache. */ - private static final Text CACHE = new Synced( - new Sticky( - CommitHashesText.asText(CommitHashesText.HOME) - ) + private static final Text CACHE = new Sticky( + CommitHashesText.asText(CommitHashesText.HOME) ); /** From d83314cb06a15297d2219edef3b09da6ce4f04d3 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 29 Apr 2024 13:33:51 +0300 Subject: [PATCH 22/58] #3139: restart ci --- .../src/main/java/org/eolang/maven/hash/CommitHashesText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java index 1e3465021c..019889d8e4 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java @@ -49,7 +49,7 @@ final class CommitHashesText extends TextEnvelope { /** * Cache. */ - private static final Text CACHE = new Sticky( + private static final Text CACHE = zzzznew Sticky( CommitHashesText.asText(CommitHashesText.HOME) ); From 734bc02a35d4e91db95e62e6c72f7430497e186a Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 29 Apr 2024 13:33:56 +0300 Subject: [PATCH 23/58] #3139: restart ci --- .../src/main/java/org/eolang/maven/hash/CommitHashesText.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java index 019889d8e4..1e3465021c 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java @@ -49,7 +49,7 @@ final class CommitHashesText extends TextEnvelope { /** * Cache. */ - private static final Text CACHE = zzzznew Sticky( + private static final Text CACHE = new Sticky( CommitHashesText.asText(CommitHashesText.HOME) ); From 7f374f591d4e19f2a19f5fc082de4c4c952d702d Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 2 May 2024 14:02:46 +0300 Subject: [PATCH 24/58] #3139: Restart ci --- .../test/java/org/eolang/maven/hash/CommitHashesTextTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java index f9b454d8ab..96256dee0a 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java @@ -40,7 +40,7 @@ final class CommitHashesTextTest { @ExtendWith(WeAreOnline.class) void downloadsDefaultList() throws Exception { MatcherAssert.assertThat( - "CommitHashesText downloads the default list of hashes from Objectionary", + "CommitHashesText downloads the default list of hashes from Objectionary", new CommitHashesText().asString(), Matchers.containsString("master") ); From c643b1f684e565206da04f5e4a88fafb9898d23c Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 2 May 2024 14:02:52 +0300 Subject: [PATCH 25/58] #3139: Restart ci --- .../test/java/org/eolang/maven/hash/CommitHashesTextTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java index 96256dee0a..f9b454d8ab 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/hash/CommitHashesTextTest.java @@ -40,7 +40,7 @@ final class CommitHashesTextTest { @ExtendWith(WeAreOnline.class) void downloadsDefaultList() throws Exception { MatcherAssert.assertThat( - "CommitHashesText downloads the default list of hashes from Objectionary", + "CommitHashesText downloads the default list of hashes from Objectionary", new CommitHashesText().asString(), Matchers.containsString("master") ); From 7c7072f9f8766dd9f2cd18230d0e6adbc6e699f8 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 2 May 2024 18:22:30 +0300 Subject: [PATCH 26/58] #3145: More concise detecting of rust inserts --- .../org/eolang/maven/add_rust/add_rust.xsl | 4 +- .../src/main/java/EOorg/EOeolang/EOrust.java | 7 +- .../src/test/eo/org/eolang/rust-tests.eo | 68 +++++++++++++++++++ 3 files changed, 74 insertions(+), 5 deletions(-) diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl index 1d9fb0e77d..5386392bfc 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl @@ -32,10 +32,10 @@ SOFTWARE. "Rust inserts" - + - + diff --git a/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java b/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java index 0b0d0743d2..66bf649a64 100644 --- a/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java +++ b/eo-runtime/src/main/java/EOorg/EOeolang/EOrust.java @@ -41,6 +41,7 @@ import java.util.Base64; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicReference; import org.eolang.AtVoid; @@ -139,9 +140,9 @@ public EOrust(final Phi sigma) { @Override public Phi lambda() throws Exception { - final String name = NAMES.get( - this.take("code").locator().split(":")[0] - ); + final String locator = this.take("code").locator().split(":")[0]; + final String name = Optional.ofNullable(NAMES.get(locator)) + .orElseThrow(() -> new ExNative("No native function for %s", locator)); final Method method = Class.forName( String.format( "EOrust.natives.%s", diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 32b159f0f6..482bfccbe9 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -391,3 +391,71 @@ eq. > @ applied.content "qwerty" + +# This is the default 64+ symbols comment in front of named abstract object. +[] > rust-with-string-fqn + Q + .org + .eolang + .rust > r + Q + .org + .eolang + .string:0 + Q + .org + .eolang + .bytes:0 + 75-73-65-20-65-6F-3A-3A-50-6F-72-74-61-6C-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3A-3A-7B-45-4F-49-6E-74-7D-3B-0A-0A-70-75-62-20-66-6E-20-66-6F-6F-28-5F-70-6F-72-74-61-6C-3A-20-26-6D-75-74-20-50-6F-72-74-61-6C-29-20-2D-3E-20-4F-70-74-69-6F-6E-3C-45-4F-3E-20-7B-0A-20-20-70-72-69-6E-74-6C-6E-21-28-22-48-65-6C-6C-6F-20-77-6F-72-6C-64-20-66-72-6F-6D-20-72-75-73-74-22-29-3B-0A-20-20-53-6F-6D-65-28-45-4F-49-6E-74-28-32-29-29-0A-7D + []:1 + Q + .org + .eolang + .tuple + .empty:2 + $ + .r + .eq > @ + Q + .org + .eolang + .int:0 + Q + .org + .eolang + .bytes:0 + 00-00-00-00-00-00-00-02 + +# This is the default 64+ symbols comment in front of named abstract object. +[] > rust-reversed-notation + rust. > r + eolang. + org. + Q + string.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 75-73-65-20-65-6F-3A-3A-50-6F-72-74-61-6C-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3A-3A-7B-45-4F-49-6E-74-7D-3B-0A-0A-70-75-62-20-66-6E-20-66-6F-6F-28-5F-70-6F-72-74-61-6C-3A-20-26-6D-75-74-20-50-6F-72-74-61-6C-29-20-2D-3E-20-4F-70-74-69-6F-6E-3C-45-4F-3E-20-7B-0A-20-20-70-72-69-6E-74-6C-6E-21-28-22-48-65-6C-6C-6F-20-77-6F-72-6C-64-20-66-72-6F-6D-20-72-75-73-74-22-29-3B-0A-20-20-53-6F-6D-65-28-45-4F-49-6E-74-28-32-29-29-0A-7D + []:1 + empty.:2 + tuple. + eolang. + org. + Q + eq. > @ + r. + $ + int.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-02 From d0c815aee7ead98bc11f0a3aac4e1c20047575eb Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Fri, 3 May 2024 14:00:53 +0300 Subject: [PATCH 27/58] #3145: Added yaml test --- .../org/eolang/maven/BinarizeParseTest.java | 2 +- .../detects-rust-with-wide-string.yaml | 146 ++++++++++++++++++ 2 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java index cabac1dc77..061136df77 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeParseTest.java @@ -151,7 +151,7 @@ void binarizesTwiceRustProgram(@TempDir final Path temp) throws Exception { @ClasspathSource(value = "org/eolang/maven/binarize/add_rust/", glob = "**.yaml") void createsDependenciesSection(final String yaml) { MatcherAssert.assertThat( - BinarizeParseTest.TO_ADD_MESSAGE, + "Yaml tests should pass", new XaxStory(yaml), Matchers.is(true) ); diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml new file mode 100644 index 0000000000..c804c7b5c9 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -0,0 +1,146 @@ +--- +sheets: + - /org/eolang/maven/add_rust/add_rust.xsl +document: + + + + + + + + + + + + + + + + + 75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 5F 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 48 65 6C 6C 6F 20 77 6F 72 6C 64 20 66 72 6F 6D 20 72 75 73 74 22 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 32 29 29 0A 7D + + + + + + + + + + + + + + + + + + + + + + + 00 00 00 00 00 00 00 02 + + + + + + +asserts: + - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-with-string-fqn.r.α0' and @code='75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 5F 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 48 65 6C 6C 6F 20 77 6F 72 6C 64 20 66 72 6F 6D 20 72 75 73 74 22 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 32 29 29 0A 7D'] + From d4eccf79e4b01a808bb6b9b1e6d3ea1f3fbe9cd5 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Fri, 3 May 2024 14:34:33 +0300 Subject: [PATCH 28/58] #3145: one empty lime only --- .../maven/binarize/add_rust/detects-rust-with-wide-string.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index c804c7b5c9..c93ce8b6cb 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -143,4 +143,3 @@ document: asserts: - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-with-string-fqn.r.α0' and @code='75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 5F 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 48 65 6C 6C 6F 20 77 6F 72 6C 64 20 66 72 6F 6D 20 72 75 73 74 22 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 32 29 29 0A 7D'] - From ea25374d593c2b1e595d38e9665eb3f90dd2b802 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Fri, 3 May 2024 15:20:15 +0300 Subject: [PATCH 29/58] fix(#3147): tests --- eo-runtime/src/main/eo/org/eolang/go.eo | 19 +++--- eo-runtime/src/main/eo/org/eolang/malloc.eo | 5 +- .../main/eo/org/eolang/negative-infinity.eo | 4 +- .../main/eo/org/eolang/positive-infinity.eo | 4 +- eo-runtime/src/main/java/org/eolang/Main.java | 4 +- .../src/test/eo/org/eolang/cage-tests.eo | 31 +++------- .../src/test/eo/org/eolang/dataized-tests.eo | 1 - .../src/test/eo/org/eolang/goto-tests.eo | 13 ++-- .../src/test/eo/org/eolang/malloc-tests.eo | 12 ++-- .../src/test/eo/org/eolang/runtime-tests.eo | 59 ++++--------------- .../src/test/eo/org/eolang/rust-tests.eo | 32 ++++------ .../src/test/eo/org/eolang/seq-tests.eo | 24 ++++---- .../src/test/eo/org/eolang/string-tests.eo | 36 +++++------ .../src/test/eo/org/eolang/switch-tests.eo | 14 ++--- .../src/test/eo/org/eolang/try-tests.eo | 53 +++++++---------- .../src/test/eo/org/eolang/tuple-tests.eo | 18 ++---- .../src/test/eo/org/eolang/while-tests.eo | 33 ++++++----- .../test/java/EOorg/EOeolang/EOfailed.java | 7 +++ 18 files changed, 146 insertions(+), 223 deletions(-) diff --git a/eo-runtime/src/main/eo/org/eolang/go.eo b/eo-runtime/src/main/eo/org/eolang/go.eo index 66a759d1ec..f41b3af95e 100644 --- a/eo-runtime/src/main/eo/org/eolang/go.eo +++ b/eo-runtime/src/main/eo/org/eolang/go.eo @@ -54,14 +54,13 @@ # ``` # Go to. [] > go - malloc.of > id! + malloc.of > id 8 m.put m.id > [m] [body] > to try > @ body token - # Exception. [e] > ex if. > @ ^.^.id.eq e.id @@ -70,16 +69,14 @@ true [] > token - # Backward jump. error > backward - # Next. - [] > next - ^.^.^.to ^.^.body > value - ^.^.^.id > id + jump + ^.^.to ^.body + + [value] > jump + ^.^.^.id > id [res] > forward error > @ - # Next. - [] > next - res > value - ^.^.^.^.id > id + jump + res diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index 8557592def..3bf656278a 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -76,12 +76,11 @@ (dataized object).as-bytes > bts malloc.of > @ bts.size - # Outer scope. [m] > outer-scope seq > @ * - m.write 0 bts - scope m + m.write 0 ^.bts + ^.scope m # Allocates block in memory of given `size`. After allocation the `size` zero bytes bytes are # written into memory. diff --git a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo index 0a72213110..d1a1fc49c0 100644 --- a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo @@ -67,7 +67,7 @@ try > @ 0.lt num [e] > ex - 0.0.lt num > @ + 0.0.lt ^.num > @ false [num] > is-nan @@ -135,7 +135,7 @@ try > @ 0.lte num [e] > ex - 0.0.lte num > @ + 0.0.lte ^.num > @ false if. > @ is-nan-or-infinite value diff --git a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo index d6b575f19f..bf7a80a078 100644 --- a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo @@ -79,7 +79,7 @@ try > @ 0.lt num [e] > ex - 0.0.lt num > @ + 0.0.lt ^.num > @ false if. > @ is-nan-or-zero value @@ -135,7 +135,7 @@ try > @ 0.lte num [e] > ex - 0.0.lte num > @ + 0.0.lte ^.num > @ false if. > @ is-nan-or-infinite value diff --git a/eo-runtime/src/main/java/org/eolang/Main.java b/eo-runtime/src/main/java/org/eolang/Main.java index b72d138df5..27c36f223d 100644 --- a/eo-runtime/src/main/java/org/eolang/Main.java +++ b/eo-runtime/src/main/java/org/eolang/Main.java @@ -178,8 +178,8 @@ private static void run(final List opts) throws Exception { try { Main.LOGGER.fine(String.format("Loading class %s...", path)); app = (Phi) Class.forName(path) - .getConstructor(Phi.class) - .newInstance(Phi.Φ); + .getConstructor() + .newInstance(); } catch (final ClassNotFoundException ex) { throw new ExUnset( String.format("Can not find '%s' object", opts.get(0)) diff --git a/eo-runtime/src/test/eo/org/eolang/cage-tests.eo b/eo-runtime/src/test/eo/org/eolang/cage-tests.eo index 876213890c..53ba6c257e 100644 --- a/eo-runtime/src/test/eo/org/eolang/cage-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/cage-tests.eo @@ -71,25 +71,17 @@ # Test. [] > multi-layer-volatility (cage a).new > ca - # Layer A. [] > a - # Layer A.phi. [] > @ - # Layer A.phi.phi. [] > @ - # Layer A.phi.phi.phi. [] > @ malloc.for > @ 0 ma.put (ma.as-int.plus 1) > [ma] (cage b).new > cb - # Layer B. [] > b - # Layer B.phi. [] > @ - # Layer B.phi.phi. [] > @ - # Layer B.phi.phi.phi. [] > @ malloc.for > z 0 @@ -106,11 +98,9 @@ # Test. [] > infinite-loop-check - # Recursive sum object. [value] > pyint - # Add. [y] > add - pyint (^.value.plus y.value) > @ + ^.^.pyint (^.value.plus y.value) > @ (cage pyint).new > x (cage x.add).new > tmp seq > @ @@ -130,7 +120,7 @@ * try cge.encage "Hello world" - [e] + [e] > ex cge.encage 10 > @ true cge.eq 10 @@ -140,15 +130,13 @@ [] > catches-stack-overflow (cage int.plus).new > cge try > @ - [] - seq > @ - * - cge.write - 0.plus cge - cge - false - [stack-overflow-message] - QQ.io.stdout stack-overflow-message > @ + seq + * + cge.write + 0.plus cge + cge + false + QQ.io.stdout stack-overflow-message > [stack-overflow-message] false # Test. @@ -156,7 +144,6 @@ new. > c cage [] - # Func. [x] > func 2.plus x > @ eq. > @ diff --git a/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo b/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo index 85ea6561bb..38c2b94dbe 100644 --- a/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo @@ -32,7 +32,6 @@ malloc.for 0 [m] - # Func. [] > func ^.m.put (^.m.as-int.plus 1) > @ (dataized func).as-bytes > cached diff --git a/eo-runtime/src/test/eo/org/eolang/goto-tests.eo b/eo-runtime/src/test/eo/org/eolang/goto-tests.eo index be5a8233b8..4881cb9c0e 100644 --- a/eo-runtime/src/test/eo/org/eolang/goto-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/goto-tests.eo @@ -37,7 +37,7 @@ * i.put 1 go.to - [g] + [g] > block seq > @ * i.put (i.as-int.plus 1) @@ -50,13 +50,12 @@ # Test. [] > goto-jumps-forward - # Div. [x] > div malloc.for > @ 0 - [r] + [r] > scope go.to > @ - [g] + [g] > block seq > @ * if. @@ -74,10 +73,9 @@ # Test. [] > returns-from-method-body - # Max. [a b] > max go.to > @ - [g] + [g] > block seq > @ * if. @@ -97,6 +95,7 @@ seq > @ * go.to - g1.forward 42 > [g2] + [g2] > block + g1.forward 42 > @ 7 42 diff --git a/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo b/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo index 805339d634..1f0861b4b0 100644 --- a/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo @@ -47,7 +47,8 @@ [f] malloc.of > second 1 - f.put (f.as-int.plus 1) > [s] + [s] > scope + f.put (f.as-int.plus 1) > @ seq > @ * second @@ -160,7 +161,8 @@ [b] malloc.of > @ 10 - b.put (m.size.eq 10) > [m] + [m] > scope + b.put (m.size.eq 10) > @ # Test. [] > malloc-writes-and-reads @@ -169,7 +171,7 @@ [b] malloc.of > @ 12 - [m] + [m] > string-scope seq > @ * m.write 0 "Hello, " @@ -186,7 +188,7 @@ [b] malloc.of > @ 3 - [m] + [m] > scope seq > @ * m.write 0 "XXX" @@ -210,7 +212,7 @@ [b] malloc.of > @ 10 - [m] + [m] > scope seq > @ * m.write 2 "Hello" 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 4bc1be6d03..a6fcaaf1ae 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -28,7 +28,6 @@ # Test. [] > understands-this-correctly - # Abstract a. [x] > a $.x > @ eq. > @ @@ -37,9 +36,7 @@ # Test. [] > takes-parent-object - # Abstract a. [x] > a - # Take. [] > take ^.x > @ take > @ @@ -49,7 +46,6 @@ # Test. [] > makes-object-a-constant - # Foo. [] > foo times. > @ 50 @@ -63,11 +59,8 @@ [] > takes-parent-through-attribute 42 > x $ > this - # Phi1. [] > @ - # Phi2. [] > @ - # Phi3. [] > @ eq. > @ this.x @@ -75,7 +68,6 @@ # Test. [] > throws-when-applies-to-closed-object - # A. [x] > a x > @ a false > closed @@ -86,7 +78,6 @@ eq. > @ x 5 0 - # X. [i] > x if. > @ i.lt 0 @@ -99,9 +90,7 @@ eq. > @ malloc.for 0 - # X. [m] > x - # A. [] > a seq > @ * @@ -116,10 +105,10 @@ eq. > @ malloc.of 8 - [f1] + [f1] > first malloc.of > @ 8 - [f0] + [f0] > second seq > @ * f0.put 1 @@ -130,7 +119,6 @@ # Test. [] > recursion-without-arguments - # Func. [n] > func if. > @ n.as-int.gt 0 @@ -142,20 +130,16 @@ eq. > @ malloc.for 4 - func m > [m] + [m] > scope + ^.func m > @ 0 # Test. [] > compiles-correctly-with-long-duplicate-names - # Long object 1. [] > long-object-name - # Long object 2. [] > long-object-name - # Long object 3. [] > long-object-name - # Long object 4. [] > long-object-name - # Long object 5. [] > long-object-name true > @ @@ -163,15 +147,12 @@ [] > named-inner-abstract-object seq > @ * - # A. [] > a true > @ # Test. [] > app-that-calls-func - # App. [] > app - # App.f. [args] > f 1 > a 2 > @ @@ -224,11 +205,9 @@ # Test. [] > extract-attribute-from-decoratee - # Return. [foo] > return - # A. [] > a - return > @ + ^.return > @ plus. 42 1 @@ -238,7 +217,6 @@ # Test. [] > constant-defends-against-side-effects - # Increment. [x] > inc seq > @ * @@ -248,9 +226,9 @@ eq. > @ malloc.for 7 - [m] + [m] > scope int > num - inc m > n! + ^.inc m > n! m.put > @ times. num @@ -260,9 +238,7 @@ # Test. [] > parent-in-vertical-notation 5 > m - # Value. [] > value - # Phi. [] > @ m. > @ ^. @@ -274,9 +250,7 @@ # Test. [] > parent-in-horizontal-notation 5 > m - # Value. [] > value - # Phi. [] > @ ^.^.m > @ eq. > @ @@ -285,9 +259,7 @@ # Test. [] > phi-in-vertical-notation - # Value. [] > value - # Phi. [] > @ 100 > @ eq. > @ @@ -297,9 +269,7 @@ # Test. [] > phi-in-horizontal-notation - # Value. [] > value - # Phi. [] > @ 100 > @ eq. > @ @@ -311,12 +281,9 @@ # Bool mock [value] > pybool value > @ - # Integer mock. [value] > pyint - # Equal. [x] > eq - pybool (^.value.eq x.value) > @ - # Add. + ^.^.pybool (^.value.eq x.value) > @ [x] > add ^.^.pyint (^.value.plus x.value) > @ ((pyint 1).add (pyint 3)).eq (pyint 4) > @ @@ -333,7 +300,6 @@ # Test. [] > correctly-handles-same-name-attrs-simplified - # Calculate. [first second] > calc plus. > @ first @@ -342,19 +308,16 @@ calc [] build 1 > @ - # Build first. [x] > build x > @ [] build 2 > @ - # Build second. [y] > build y > @ 3 # Test. [] > correctly-handles-same-name-attrs - # Calculate. [f s] > calc plus. > @ f.next @@ -362,19 +325,17 @@ eq. > @ calc [] - # Build first. [x] > build x.plus 1 > @ - build > next + ^.build > next plus. x 1 build 1 > @ [] - # Build second. [y] > build y.plus 2 > @ - build > next + ^.build > next plus. y 2 diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index ec920f36cc..333dbe316c 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -138,7 +138,7 @@ ) } """ - [] + [] > p * not. > @ lt. @@ -159,7 +159,7 @@ Some(EOVertex(v)) } """ - [] + [] > p * eq. > @ read @@ -202,10 +202,8 @@ eq. > @ slice. try - [] - put > @ - [e] - e > @ + put + e > [e] true 0 length. @@ -230,13 +228,11 @@ Some(EOInt(0 as i64)) } """ - [] + [] > p * try > res - [] - insert > @ - [e] - e > @ + insert + e > [e] true eq. > @ res.slice @@ -259,7 +255,7 @@ Some(EOVertex(copy)) } """ - [] + [] > p * eq. > @ copy @@ -280,7 +276,7 @@ Some(EOInt(v as i64)) } """ - [] + [] > p * not. > @ lt. @@ -310,7 +306,7 @@ Some(EOInt(a + b)) } """ - [] + [] > p * "byteorder:1.4.3" eq. > @ @@ -333,10 +329,8 @@ [] * try > res - [] - err > @ - [e] - e > @ + err + e > [e] true eq. > @ slice. @@ -386,7 +380,7 @@ Some(EOVertex(copy)) } """ - [] + [] > p * eq. > @ applied.content diff --git a/eo-runtime/src/test/eo/org/eolang/seq-tests.eo b/eo-runtime/src/test/eo/org/eolang/seq-tests.eo index bbcc3e4147..4119cdd142 100644 --- a/eo-runtime/src/test/eo/org/eolang/seq-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/seq-tests.eo @@ -30,10 +30,10 @@ [] > seq-single-dataization-float-less malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0.0 - [m] + [m] > float-scope b.put > @ lt. seq @@ -46,10 +46,10 @@ [] > seq-single-dataization-float-greater malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0.0 - [m] + [m] > float-scope b.put > @ gt. seq @@ -62,10 +62,10 @@ [] > seq-single-dataization-int-less malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0 - [m] + [m] > int-scope b.put > @ lt. seq @@ -78,10 +78,10 @@ [] > seq-single-dataization-int-less-or-equal malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0 - [m] + [m] > int-scope b.put > @ lte. seq @@ -143,10 +143,10 @@ [] > seq-single-dataization-int-equal-to-test malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0 - [m] + [m] > int-scope b.put > @ eq. seq @@ -160,10 +160,10 @@ [] > seq-single-dataization-int-equal-to-cache-problem-test malloc.of > @ 1 - [b] + [b] > bool-scope malloc.for > @ 0 - [m] + [m] > int-scope b.put > @ eq. seq diff --git a/eo-runtime/src/test/eo/org/eolang/string-tests.eo b/eo-runtime/src/test/eo/org/eolang/string-tests.eo index 9fac0c64e3..0e90be9ed7 100644 --- a/eo-runtime/src/test/eo/org/eolang/string-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/string-tests.eo @@ -233,35 +233,29 @@ # Test. [] > slice-start-below-zero try > @ - [] - slice. > @ - "some string" - -1 - 1 - [e] - QQ.io.stdout e > @ + slice. + "some string" + -1 + 1 + QQ.io.stdout e > [e] true # Test. [] > slice-end-below-start try > @ - [] - slice. > @ - "some string" - 2 - -1 - [e] - QQ.io.stdout e > @ + slice. + "some string" + 2 + -1 + QQ.io.stdout e > [e] true # Test. [] > slice-end-greater-actual try > @ - [] - slice. > @ - "some string" - 7 - 5 - [e] - QQ.io.stdout e > @ + slice. + "some string" + 7 + 5 + QQ.io.stdout e > [e] true diff --git a/eo-runtime/src/test/eo/org/eolang/switch-tests.eo b/eo-runtime/src/test/eo/org/eolang/switch-tests.eo index b02af80128..8749205abb 100644 --- a/eo-runtime/src/test/eo/org/eolang/switch-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/switch-tests.eo @@ -87,34 +87,30 @@ [] > switch-case-with-error try > @ switch * - [ex] - QQ.io.stdout ex > @ - true + QQ.io.stdout ex > [ex] + false # Test. [] > switch-complex-case - # Inner object 1. [] > c1 false > @ - # Inner object 1. [] > c2 "1".eq "2" > @ - # Inner object 1. [] > c3 true > @ eq. > @ switch * * - [] + [] > f c1 > @ 22.0 * - [] + [] > s c2 > @ 0.0 * - [] + [] > t c3 > @ [] "true case" > @ diff --git a/eo-runtime/src/test/eo/org/eolang/try-tests.eo b/eo-runtime/src/test/eo/org/eolang/try-tests.eo index fa75c42ac6..7e6b9cedf5 100644 --- a/eo-runtime/src/test/eo/org/eolang/try-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/try-tests.eo @@ -29,47 +29,39 @@ # Test. [] > simple-division-by-zero try > @ - [] - 42.div 0 > @ - [e] - QQ.io.stdout > @ - e - [] - QQ.io.stdout > @ - "\nfinally" + 42.div 0 + QQ.io.stdout e > [e] + QQ.io.stdout + "\nfinally" # Test. [] > catches-simple-exception try > @ - [] - slice. > @ - "some string" - 7 - 5 + slice. + "some string" + 7 + 5 QQ.io.stdout e > [e] - false > [] + false # Test. [] > two-nested-try-blocks try > @ - [] - try > @ - [] - slice. > @ - "some string" - 7 - 5 - error e > [e] - true - [e] - QQ.io.stdout e > @ + try + slice. + "some string" + 7 + 5 + error e > [e] + true + QQ.io.stdout e > [e] true # Test. [] > try-without-error-block eq. > @ try - 30.plus 2 > [] + 30.plus 2 e > [e] true 32 @@ -84,11 +76,10 @@ * m.put 1 try - [] - seq > @ - * - 5.div 0 - m.put (m.plus 1) + seq + * + 5.div 0 + m.put (m.plus 1) e > [e] false 1 diff --git a/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo b/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo index 6ae8002b7f..415ecd107b 100644 --- a/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo @@ -40,7 +40,6 @@ # Check that an empty tuples .length equals to zero. [] > empty-tuple-length - # Array. [elements] > arr eq. > @ (arr *).elements.length @@ -48,7 +47,6 @@ # Check that tuple.length works properly for non-empty tuples. [] > non-empty-tuple-length-test - # Array. [elements] > arr eq. > @ arr @@ -109,12 +107,10 @@ # Test. [] > tuple-at-with-error try > @ - [] - at. > @ - * 1 2 3 4 - 20 - [e] - QQ.io.stdout e > @ + at. + * 1 2 3 4 + 20 + QQ.io.stdout e > [e] true # Test. @@ -221,8 +217,6 @@ [] > tuple-with-negative-index-out-of-bounds * 0 1 2 3 4 > arr try > @ - [] - arr.at -6 > @ - [e] - QQ.io.stdout e > @ + arr.at -6 + QQ.io.stdout e > [e] true diff --git a/eo-runtime/src/test/eo/org/eolang/while-tests.eo b/eo-runtime/src/test/eo/org/eolang/while-tests.eo index 542df51713..389341a7a7 100644 --- a/eo-runtime/src/test/eo/org/eolang/while-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/while-tests.eo @@ -41,7 +41,8 @@ [m] while > @ m - m.put false > [i] + [i] > cycle + m.put false > @ false # Test. @@ -52,7 +53,8 @@ [m] while > @ 2.gt m - m.put (m.as-int.plus 1) > [i] + [i] > cycle + m.put (m.as-int.plus 1) > @ 3 # Test. @@ -65,13 +67,13 @@ # Test. [] > iterating-tuple-with-while-using-internal-iterator * 1 1 1 1 > arr - arr.length.plus -1 > max + arr.length.plus -1 malloc.for > data 0 - [acc] + [acc] > acc-scope malloc.for > @ 0 - [iter] + [iter] > iter-scope if. > @ max.eq 0 acc.put @@ -79,7 +81,7 @@ arr.at 0 while max.gt iter - [i] + [i] > cycle seq > @ * acc.put @@ -95,13 +97,13 @@ arr.length.plus -1 > max malloc.for > data 0 - [acc] + [acc] > acc-scope malloc.for > @ 0 - [iter] + [iter] > iter-scope while > @ max.gt iter - [i] + [i] > cycle seq > @ * acc.put @@ -117,12 +119,12 @@ arr.length > max malloc.for > data 0 - [acc] + [acc] > acc-scope malloc.for > @ 0 - [iter] + [iter] > iter-scope while > @ - [] + [i] > condition-cycle if. > @ max.gt iter seq @@ -138,18 +140,19 @@ true > [i] data.eq arr.length > @ + # Test. [] > iterating-tuple-with-while-without-body-single * 1 > arr arr.length > max malloc.for > data 0 - [acc] + [acc] > acc-scope malloc.for > @ 0 - [iter] + [iter] > iter-scope while > @ - [] + [] > condition-cycle if. > @ max.gt iter seq diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java index acab47730c..b298fe95b8 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java @@ -41,4 +41,11 @@ "JTCOP.RuleInheritanceInTests" }) public final class EOfailed extends PhDefault { + /** + * Ctor. + * @param arg Argument + */ + public EOfailed(final String arg) { + super(); + } } From fa69993797722a7ae3c8c801f6944581548b0063 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 6 May 2024 13:03:43 +0300 Subject: [PATCH 30/58] #3139: Added license --- .../org/eolang/maven/print/xmir/inner/a.xmir | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir index e7f393d117..065142866e 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir @@ -1,3 +1,26 @@ + Date: Mon, 6 May 2024 13:05:13 +0300 Subject: [PATCH 31/58] #3139: removed license --- .../org/eolang/maven/print/xmir/inner/a.xmir | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir index 065142866e..e7f393d117 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/xmir/inner/a.xmir @@ -1,26 +1,3 @@ - Date: Mon, 6 May 2024 13:16:49 +0300 Subject: [PATCH 32/58] #3145: restart ci --- .../maven/binarize/add_rust/detects-rust-with-wide-string.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index c93ce8b6cb..7fe83c4ddf 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -3,6 +3,7 @@ sheets: - /org/eolang/maven/add_rust/add_rust.xsl document: + Date: Mon, 6 May 2024 13:16:54 +0300 Subject: [PATCH 33/58] #3145: restart ci --- .../maven/binarize/add_rust/detects-rust-with-wide-string.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index 7fe83c4ddf..c93ce8b6cb 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -3,7 +3,6 @@ sheets: - /org/eolang/maven/add_rust/add_rust.xsl document: - Date: Mon, 6 May 2024 13:28:41 +0300 Subject: [PATCH 34/58] #3145: Added license --- .../detects-rust-with-wide-string.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index c93ce8b6cb..83b3e02e67 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -1,3 +1,24 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. --- sheets: - /org/eolang/maven/add_rust/add_rust.xsl From 27e718130db26ce2ad4725fcc59e1f70e03990b9 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 6 May 2024 13:47:31 +0300 Subject: [PATCH 35/58] #3145: restart ci --- .../maven/binarize/add_rust/detects-rust-with-wide-string.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index 83b3e02e67..24812ccc80 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -11,7 +11,7 @@ # # 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 From 423270ce8f130438db66ad07e4bc8d5d2b1f200b Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Mon, 6 May 2024 13:47:35 +0300 Subject: [PATCH 36/58] #3145: restart ci --- .../maven/binarize/add_rust/detects-rust-with-wide-string.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml index 24812ccc80..83b3e02e67 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml @@ -11,7 +11,7 @@ # # 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 From d5615ee21f219ac2809b591b05512d1030428bd8 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Mon, 6 May 2024 15:30:51 +0300 Subject: [PATCH 37/58] fix(#3147): tests --- eo-runtime/src/main/eo/org/eolang/go.eo | 6 ++-- eo-runtime/src/main/eo/org/eolang/malloc.eo | 2 +- .../main/eo/org/eolang/negative-infinity.eo | 6 ++-- .../main/eo/org/eolang/positive-infinity.eo | 6 ++-- .../src/main/java/org/eolang/AtSetRho.java | 9 +++-- .../src/test/eo/org/eolang/goto-tests.eo | 10 +++--- .../src/test/eo/org/eolang/malloc-tests.eo | 33 ++++++++++--------- .../src/test/eo/org/eolang/runtime-tests.eo | 8 ++--- .../src/test/eo/org/eolang/rust-tests.eo | 14 ++++---- .../src/test/eo/org/eolang/seq-tests.eo | 24 +++++++------- .../src/test/eo/org/eolang/switch-tests.eo | 6 ++-- 11 files changed, 63 insertions(+), 61 deletions(-) diff --git a/eo-runtime/src/main/eo/org/eolang/go.eo b/eo-runtime/src/main/eo/org/eolang/go.eo index f41b3af95e..b02d745d12 100644 --- a/eo-runtime/src/main/eo/org/eolang/go.eo +++ b/eo-runtime/src/main/eo/org/eolang/go.eo @@ -54,14 +54,14 @@ # ``` # Go to. [] > go - malloc.of > id + malloc.of > id! 8 m.put m.id > [m] [body] > to try > @ body token - [e] > ex + [e] >> if. > @ ^.^.id.eq e.id e.value @@ -78,5 +78,5 @@ [res] > forward error > @ - jump + ^.jump res diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index 05c94a07ff..54535acf42 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -76,7 +76,7 @@ (dataized object).as-bytes > bts malloc.of > @ bts.size - [m] > outer-scope + [m] >> seq > @ * m.write 0 ^.bts diff --git a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo index d1a1fc49c0..8d8cc96a01 100644 --- a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo @@ -66,8 +66,7 @@ [num] > is-num-gt-zero try > @ 0.lt num - [e] > ex - 0.0.lt ^.num > @ + 0.0.lt ^.num > [e] >> false [num] > is-nan @@ -134,8 +133,7 @@ [num] > is-num-gte-zero try > @ 0.lte num - [e] > ex - 0.0.lte ^.num > @ + 0.0.lte ^.num > [e] >> false if. > @ is-nan-or-infinite value diff --git a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo index bf7a80a078..ff92b883e3 100644 --- a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo @@ -78,8 +78,7 @@ [num] > is-num-gt-zero try > @ 0.lt num - [e] > ex - 0.0.lt ^.num > @ + 0.0.lt ^.num > [e] >> false if. > @ is-nan-or-zero value @@ -134,8 +133,7 @@ [num] > is-num-gte-zero try > @ 0.lte num - [e] > ex - 0.0.lte ^.num > @ + 0.0.lte ^.num > [e] >> false if. > @ is-nan-or-infinite value diff --git a/eo-runtime/src/main/java/org/eolang/AtSetRho.java b/eo-runtime/src/main/java/org/eolang/AtSetRho.java index 96c2223081..5bcafc3c63 100644 --- a/eo-runtime/src/main/java/org/eolang/AtSetRho.java +++ b/eo-runtime/src/main/java/org/eolang/AtSetRho.java @@ -54,8 +54,13 @@ final class AtSetRho extends AtEnvelope { Phi ret = attr.get(); if (!name.equals(Attr.RHO)) { final Phi copy = ret.copy(); - if (copy.put(Attr.RHO, rho)) { - ret = copy; + try { + if (copy.put(Attr.RHO, rho)) { + ret = copy; + } + } catch (Exception e) { + System.out.println(e); + throw e; } } return ret; diff --git a/eo-runtime/src/test/eo/org/eolang/goto-tests.eo b/eo-runtime/src/test/eo/org/eolang/goto-tests.eo index 4881cb9c0e..5798d9ca57 100644 --- a/eo-runtime/src/test/eo/org/eolang/goto-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/goto-tests.eo @@ -37,7 +37,7 @@ * i.put 1 go.to - [g] > block + [g] >> seq > @ * i.put (i.as-int.plus 1) @@ -53,9 +53,9 @@ [x] > div malloc.for > @ 0 - [r] > scope + [r] >> go.to > @ - [g] > block + [g] >> seq > @ * if. @@ -75,7 +75,7 @@ [] > returns-from-method-body [a b] > max go.to > @ - [g] > block + [g] >> seq > @ * if. @@ -95,7 +95,7 @@ seq > @ * go.to - [g2] > block + [g2] >> g1.forward 42 > @ 7 42 diff --git a/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo b/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo index 1f0861b4b0..c196744246 100644 --- a/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo @@ -42,18 +42,19 @@ # Test. [] > malloc-scope-is-dataized-twice - malloc.for > first - 0 - [f] - malloc.of > second - 1 - [s] > scope - f.put (f.as-int.plus 1) > @ - seq > @ - * - second - second - first.eq 2 > @ + eq. > @ + 2 + malloc.for + 0 + [f] + malloc.of > second + 1 + [s] >> + f.put (f.as-int.plus 1) > @ + seq > @ + * + second + second # Test. [] > malloc-for-writes-first-init-value @@ -161,7 +162,7 @@ [b] malloc.of > @ 10 - [m] > scope + [m] >> b.put (m.size.eq 10) > @ # Test. @@ -171,7 +172,7 @@ [b] malloc.of > @ 12 - [m] > string-scope + [m] >> seq > @ * m.write 0 "Hello, " @@ -188,7 +189,7 @@ [b] malloc.of > @ 3 - [m] > scope + [m] >> seq > @ * m.write 0 "XXX" @@ -212,7 +213,7 @@ [b] malloc.of > @ 10 - [m] > scope + [m] >> seq > @ * m.write 2 "Hello" 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 a6fcaaf1ae..1beeb38b67 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -105,10 +105,10 @@ eq. > @ malloc.of 8 - [f1] > first + [f1] >> malloc.of > @ 8 - [f0] > second + [f0] >> seq > @ * f0.put 1 @@ -130,7 +130,7 @@ eq. > @ malloc.for 4 - [m] > scope + [m] >> ^.func m > @ 0 @@ -226,7 +226,7 @@ eq. > @ malloc.for 7 - [m] > scope + [m] >> int > num ^.inc m > n! m.put > @ diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 333dbe316c..62d4e80b06 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -138,7 +138,7 @@ ) } """ - [] > p + [] >> * not. > @ lt. @@ -159,7 +159,7 @@ Some(EOVertex(v)) } """ - [] > p + [] >> * eq. > @ read @@ -228,7 +228,7 @@ Some(EOInt(0 as i64)) } """ - [] > p + [] >> * try > res insert @@ -255,7 +255,7 @@ Some(EOVertex(copy)) } """ - [] > p + [] >> * eq. > @ copy @@ -276,7 +276,7 @@ Some(EOInt(v as i64)) } """ - [] > p + [] >> * not. > @ lt. @@ -306,7 +306,7 @@ Some(EOInt(a + b)) } """ - [] > p + [] >> * "byteorder:1.4.3" eq. > @ @@ -380,7 +380,7 @@ Some(EOVertex(copy)) } """ - [] > p + [] >> * eq. > @ applied.content diff --git a/eo-runtime/src/test/eo/org/eolang/seq-tests.eo b/eo-runtime/src/test/eo/org/eolang/seq-tests.eo index 4119cdd142..9b154587d5 100644 --- a/eo-runtime/src/test/eo/org/eolang/seq-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/seq-tests.eo @@ -30,10 +30,10 @@ [] > seq-single-dataization-float-less malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0.0 - [m] > float-scope + [m] >> b.put > @ lt. seq @@ -46,10 +46,10 @@ [] > seq-single-dataization-float-greater malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0.0 - [m] > float-scope + [m] >> b.put > @ gt. seq @@ -62,10 +62,10 @@ [] > seq-single-dataization-int-less malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0 - [m] > int-scope + [m] >> b.put > @ lt. seq @@ -78,10 +78,10 @@ [] > seq-single-dataization-int-less-or-equal malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0 - [m] > int-scope + [m] >> b.put > @ lte. seq @@ -143,10 +143,10 @@ [] > seq-single-dataization-int-equal-to-test malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0 - [m] > int-scope + [m] >> b.put > @ eq. seq @@ -160,10 +160,10 @@ [] > seq-single-dataization-int-equal-to-cache-problem-test malloc.of > @ 1 - [b] > bool-scope + [b] malloc.for > @ 0 - [m] > int-scope + [m] >> b.put > @ eq. seq diff --git a/eo-runtime/src/test/eo/org/eolang/switch-tests.eo b/eo-runtime/src/test/eo/org/eolang/switch-tests.eo index 8749205abb..d0d355a089 100644 --- a/eo-runtime/src/test/eo/org/eolang/switch-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/switch-tests.eo @@ -102,15 +102,15 @@ switch * * - [] > f + [] >> c1 > @ 22.0 * - [] > s + [] >> c2 > @ 0.0 * - [] > t + [] >> c3 > @ [] "true case" > @ From 7c0e03be2693cb25fa3a22971cf00eb1f3604ed1 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Mon, 6 May 2024 16:46:55 +0300 Subject: [PATCH 38/58] fix(#3169): decapitalize auto named objects on phi --- .../main/java/org/eolang/maven/PhiMojo.java | 29 +++++--- .../maven/phi/decapitalize-auto-named.xsl | 61 ++++++++++++++++ .../packs/{pre => }/as-type-optimization.yaml | 0 .../packs/{pre => }/bindings-to-java.yaml | 0 ...nverts-to-java-with-arrays-and-scopes.yaml | 0 .../maven/packs/{pre => }/data-as-bytes.yaml | 0 .../maven/packs/decapitalize-auto-named.yaml | 71 +++++++++++++++++++ .../maven/packs/{pre => }/dot-home.yaml | 0 .../maven/packs/{pre => }/embedded-class.yaml | 0 .../packs/{pre => }/locators-to-java.yaml | 0 .../packs/{pre => }/long-class-name.yaml | 0 .../maven/packs/{pre => }/set-package.yaml | 0 .../synthetic-attributes-with-to-java.yaml | 0 .../packs/{pre => }/test-object-to-java.yaml | 0 .../packs/{pre => }/tests-moving-inside.yaml | 0 .../maven/packs/{pre => }/tests-test.yaml | 0 .../maven/packs/{pre => }/tuple-to-java.yaml | 0 .../packs/{pre => }/underscore-to-java.yaml | 0 .../org/eolang/maven/phi/yaml/auto-named.yaml | 43 +++++++++++ .../org/eolang/maven/unphi/auto-named.yaml | 28 ++++++++ 20 files changed, 224 insertions(+), 8 deletions(-) create mode 100644 eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/as-type-optimization.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/bindings-to-java.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/converts-to-java-with-arrays-and-scopes.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/data-as-bytes.yaml (100%) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/dot-home.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/embedded-class.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/locators-to-java.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/long-class-name.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/set-package.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/synthetic-attributes-with-to-java.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/test-object-to-java.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/tests-moving-inside.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/tests-test.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/tuple-to-java.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/packs/{pre => }/underscore-to-java.yaml (100%) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/auto-named.yaml diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java index 639ba36302..6c580f65ae 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java @@ -27,8 +27,9 @@ import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; import com.yegor256.xsline.Shift; -import com.yegor256.xsline.StClasspath; +import com.yegor256.xsline.TrClasspath; import com.yegor256.xsline.TrDefault; +import com.yegor256.xsline.TrJoined; import com.yegor256.xsline.Train; import com.yegor256.xsline.Xsline; import java.io.File; @@ -62,7 +63,15 @@ public final class PhiMojo extends SafeMojo { /** * Extension of the file where we put phi-calculus expression (.phi). */ - public static final String EXT = "phi"; + static final String EXT = "phi"; + + /** + * Sheets for converting to phi. + */ + private static final String[] SHEETS = { + "/org/eolang/maven/phi/decapitalize-auto-named.xsl", + "/org/eolang/maven/phi/to-phi.xsl", + }; /** * The directory where to take xmir files for translation from. @@ -98,12 +107,18 @@ public final class PhiMojo extends SafeMojo { @Override public void exec() { final Home home = new HmBase(this.phiOutputDir); - final Train train; + final Train def; if (this.phiOptimize) { - train = new ParsingTrain(); + def = new ParsingTrain(); } else { - train = new TrDefault<>(); + def = new TrDefault<>(); } + final Train train = new TrJoined<>( + def, + new TrClasspath<>( + PhiMojo.SHEETS + ).back() + ); final int count = new SumOf( new Threads<>( Runtime.getRuntime().availableProcessors(), @@ -174,9 +189,7 @@ count, new Rel(this.phiInputDir), new Rel(this.phiOutputDir) */ private static String translated(final Train train, final XML xmir) throws ImpossibleToPhiTranslationException { - final XML translated = new Xsline( - train.with(new StClasspath("/org/eolang/maven/phi/to-phi.xsl")) - ).pass(xmir); + final XML translated = new Xsline(train).pass(xmir); Logger.debug(PhiMojo.class, "XML after translation to phi:\n%s", translated); final List phi = translated.xpath("phi/text()"); if (phi.isEmpty()) { diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl new file mode 100644 index 0000000000..cb17e1d71c --- /dev/null +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/as-type-optimization.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/as-type-optimization.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/as-type-optimization.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/as-type-optimization.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/bindings-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/bindings-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/bindings-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/bindings-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/converts-to-java-with-arrays-and-scopes.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/converts-to-java-with-arrays-and-scopes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/converts-to-java-with-arrays-and-scopes.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/data-as-bytes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/data-as-bytes.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/data-as-bytes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/data-as-bytes.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml new file mode 100644 index 0000000000..7d6689ec9c --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml @@ -0,0 +1,71 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. +--- +xsls: + - /org/eolang/parser/errors/not-empty-atoms.xsl + - /org/eolang/parser/critical-errors/duplicate-names.xsl + - /org/eolang/parser/errors/many-free-attributes.xsl + - /org/eolang/parser/errors/broken-aliases.xsl + - /org/eolang/parser/errors/duplicate-aliases.xsl + - /org/eolang/parser/errors/global-nonames.xsl + - /org/eolang/parser/errors/same-line-names.xsl + - /org/eolang/parser/errors/self-naming.xsl + - /org/eolang/parser/cti/cti-adds-errors.xsl + - /org/eolang/parser/add-refs.xsl + - /org/eolang/parser/wrap-method-calls.xsl + - /org/eolang/parser/expand-qqs.xsl + - /org/eolang/parser/add-probes.xsl + - /org/eolang/parser/vars-float-up.xsl + - /org/eolang/parser/add-refs.xsl + - /org/eolang/parser/warnings/sparse-decoration.xsl + - /org/eolang/parser/warnings/unsorted-metas.xsl + - /org/eolang/parser/warnings/incorrect-architect.xsl + - /org/eolang/parser/warnings/incorrect-home.xsl + - /org/eolang/parser/warnings/incorrect-version.xsl + - /org/eolang/parser/expand-aliases.xsl + - /org/eolang/parser/resolve-aliases.xsl + - /org/eolang/parser/add-refs.xsl + - /org/eolang/parser/add-default-package.xsl + - /org/eolang/parser/errors/broken-refs.xsl + - /org/eolang/parser/errors/unknown-names.xsl + - /org/eolang/parser/errors/noname-attributes.xsl + - /org/eolang/parser/critical-errors/duplicate-names.xsl + - /org/eolang/parser/warnings/duplicate-metas.xsl + - /org/eolang/parser/warnings/mandatory-package-meta.xsl + - /org/eolang/parser/warnings/mandatory-home-meta.xsl + - /org/eolang/parser/warnings/mandatory-version-meta.xsl + - /org/eolang/parser/warnings/correct-package-meta.xsl + - /org/eolang/parser/warnings/prohibited-package.xsl + - /org/eolang/parser/errors/external-weak-typed-atoms.xsl + - /org/eolang/parser/errors/unused-aliases.xsl + - /org/eolang/parser/warnings/unit-test-without-phi.xsl + - /org/eolang/parser/explicit-data.xsl + - /org/eolang/parser/const-to-dataized.xsl + - /org/eolang/parser/set-locators.xsl + - /org/eolang/maven/phi/decapitalize-auto-named.xsl +tests: + - //o[@abstract and @name='obj-2-4' and count(o)=1] + - //o[@base='obj-2-4'] +eo: | + x + [] >> + 5 > five \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/dot-home.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/dot-home.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/dot-home.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/embedded-class.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/embedded-class.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/embedded-class.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/locators-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/locators-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/locators-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/locators-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/long-class-name.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/long-class-name.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/long-class-name.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/long-class-name.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/set-package.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/set-package.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/set-package.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/set-package.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/synthetic-attributes-with-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/synthetic-attributes-with-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/synthetic-attributes-with-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/test-object-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/test-object-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/test-object-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/test-object-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tests-moving-inside.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tests-moving-inside.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tests-moving-inside.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tests-moving-inside.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tests-test.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tests-test.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tests-test.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tests-test.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tuple-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tuple-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/tuple-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/tuple-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/underscore-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/underscore-to-java.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/packs/pre/underscore-to-java.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/packs/underscore-to-java.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml new file mode 100644 index 0000000000..7dbf930adf --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml @@ -0,0 +1,43 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. +--- +eo: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > object + x > first + [] >> + 01- > b +phi: |- + { + ⟦ + object ↦ ⟦ + first ↦ Φ.org.eolang.x( + α0 ↦ ξ.obj-4-6 + ), + obj-4-6 ↦ ⟦ + b ↦ Φ.org.eolang.bytes( + Δ ⤍ 01- + ) + ⟧ + ⟧ + ⟧ + } diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/auto-named.yaml new file mode 100644 index 0000000000..6d35d69377 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/auto-named.yaml @@ -0,0 +1,28 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. +--- +tests: + - /program/objects/o[@name='main' and @atom and @abstract] + - /program/objects/o[@name='outer' and @abstract] + - /program/objects/o[@name='outer' and @abstract]/o[@name='inner' and @atom and @abstract] +phi: + "{⟦main ↦ ⟦λ ⤍ Lambda⟧, outer ↦ ⟦inner ↦ ⟦λ ⤍ Lambda⟧⟧⟧}" From b1df99d63ef2bbd5667fe4cdcdcea126892f7e56 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Mon, 6 May 2024 16:49:26 +0300 Subject: [PATCH 39/58] fix(#3169): new line --- .../org/eolang/maven/packs/decapitalize-auto-named.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml index 7d6689ec9c..d8481b19fc 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml @@ -68,4 +68,4 @@ tests: eo: | x [] >> - 5 > five \ No newline at end of file + 5 > five From 3fa635bbe710d677e63028d18dba5dca8efd179a Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 11:49:16 +0300 Subject: [PATCH 40/58] we are online --- eo-maven-plugin/pom.xml | 125 +++++++++--------- .../eolang/maven/hash/CommitHashesMap.java | 51 +++---- .../eolang/maven/hash/CommitHashesText.java | 21 ++- .../org/eolang/maven/BinarizeMojoTest.java | 2 + eo-runtime/pom.xml | 125 +++++++++--------- eo-runtime/src/main/eo/org/eolang/int.eo | 4 +- 6 files changed, 180 insertions(+), 148 deletions(-) diff --git a/eo-maven-plugin/pom.xml b/eo-maven-plugin/pom.xml index 481690f0e6..03b8f255df 100644 --- a/eo-maven-plugin/pom.xml +++ b/eo-maven-plugin/pom.xml @@ -435,68 +435,75 @@ SOFTWARE. - - org.jacoco - jacoco-maven-plugin - - - jacoco-initialize - - prepare-agent - - - - jacoco-check - test - - check - report - - - - - BUNDLE - - - INSTRUCTION - COVEREDRATIO - 0.70 - - - LINE - COVEREDRATIO - 0.73 - - - BRANCH - COVEREDRATIO - 0.54 - - - COMPLEXITY - COVEREDRATIO - 0.60 - - - METHOD - COVEREDRATIO - 0.79 - - - CLASS - MISSEDCOUNT - 8 - - - - - - - - + + jacoco + + + + org.jacoco + jacoco-maven-plugin + + + jacoco-initialize + + prepare-agent + + + + jacoco-check + test + + check + report + + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.70 + + + LINE + COVEREDRATIO + 0.73 + + + BRANCH + COVEREDRATIO + 0.54 + + + COMPLEXITY + COVEREDRATIO + 0.60 + + + METHOD + COVEREDRATIO + 0.79 + + + CLASS + MISSEDCOUNT + 8 + + + + + + + + + + + qulice diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesMap.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesMap.java index 9843c434fe..fb9f404172 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesMap.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesMap.java @@ -41,6 +41,31 @@ */ public final class CommitHashesMap extends MapEnvelope { + /** + * Fake hashes. + */ + static final String FAKES = String.join( + "\n", + "5fe5ad8d21dbe418038fa4c86e096fb037f290a9 0.23.15", + "15c85d7f8cffe15b0deba96e90bdac98a76293bb 0.23.17", + "4b19944d86058e3c81e558340a3a13bc335a2b48 0.23.19", + "0aa6875c40d099c3f670e93d4134b629566c5643 0.25.0", + "ff32e9ff70c2b3be75982757f4b0607dc37b258a 0.25.5", + "e0b783692ef749bb184244acb2401f551388a328 0.26.0", + "cc554ab82909eebbfdacd8a840f9cf42a99b64cf 0.27.0", + "00b60c7b2112cbad4e37ba96b162469a0e75f6df 0.27.2", + "6a70071580e95aeac104b2e48293d3dfe0669973 0.28.0", + "0c15066a2026cec69d613b709a301f1573f138ec 0.28.1", + "9b883935257bd59d1ba36240f7e213d4890df7ca 0.28.10", + "a7a4556bf1aa697324d805570f42d70affdddb75 0.28.14", + "54d83d4b1d28075ee623d58fd742eaa529febd3d 0.28.2", + "6c6269d1f9a1c81ffe641538f119fe4e12706cb3 0.28.4", + "9c9352890b5d30e1b89c9147e7c95a90c9b8709f 0.28.5", + "17f89293e5ae6115e9a0234b754b22918c11c602 0.28.6", + "5f82cc1edffad67bf4ba816610191403eb18af5d 0.28.7", + "be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9" + ); + /** * Whitespace pattern. */ @@ -105,31 +130,7 @@ public static final class Fake extends MapEnvelope { * Ctor. */ public Fake() { - super( - new CommitHashesMap( - String.join( - "\n", - "5fe5ad8d21dbe418038fa4c86e096fb037f290a9 0.23.15", - "15c85d7f8cffe15b0deba96e90bdac98a76293bb 0.23.17", - "4b19944d86058e3c81e558340a3a13bc335a2b48 0.23.19", - "0aa6875c40d099c3f670e93d4134b629566c5643 0.25.0", - "ff32e9ff70c2b3be75982757f4b0607dc37b258a 0.25.5", - "e0b783692ef749bb184244acb2401f551388a328 0.26.0", - "cc554ab82909eebbfdacd8a840f9cf42a99b64cf 0.27.0", - "00b60c7b2112cbad4e37ba96b162469a0e75f6df 0.27.2", - "6a70071580e95aeac104b2e48293d3dfe0669973 0.28.0", - "0c15066a2026cec69d613b709a301f1573f138ec 0.28.1", - "9b883935257bd59d1ba36240f7e213d4890df7ca 0.28.10", - "a7a4556bf1aa697324d805570f42d70affdddb75 0.28.14", - "54d83d4b1d28075ee623d58fd742eaa529febd3d 0.28.2", - "6c6269d1f9a1c81ffe641538f119fe4e12706cb3 0.28.4", - "9c9352890b5d30e1b89c9147e7c95a90c9b8709f 0.28.5", - "17f89293e5ae6115e9a0234b754b22918c11c602 0.28.6", - "5f82cc1edffad67bf4ba816610191403eb18af5d 0.28.7", - "be83d9adda4b7c9e670e625fe951c80f3ead4177 0.28.9" - ) - ) - ); + super(new CommitHashesMap(CommitHashesMap.FAKES)); } } } diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java index 0d101290f6..36ccb33f52 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/hash/CommitHashesText.java @@ -24,6 +24,7 @@ package org.eolang.maven.hash; import com.jcabi.aspects.RetryOnFailure; +import com.jcabi.log.Logger; import java.net.URL; import java.util.concurrent.TimeUnit; import org.cactoos.scalar.Unchecked; @@ -32,8 +33,9 @@ /** * Commit hashes table as text from objectionary. - * This class serves the purpose of the global cache in order to avoid - * downloading the list of tags multiple times from objectionary. + * + *

This class serves the purpose of the global cache in order to avoid + * downloading the list of tags multiple times from objectionary.

* * @since 0.29.6 */ @@ -64,7 +66,20 @@ final class CommitHashesText extends TextEnvelope { @RetryOnFailure(delay = 1L, unit = TimeUnit.SECONDS) private static String asText(final String url) { return new Unchecked<>( - () -> new TextOf(new URL(url)).asString() + () -> { + String hashes; + try { + hashes = new TextOf(new URL(url)).asString(); + } catch (final java.net.UnknownHostException ex) { + Logger.warn( + CommitHashesText.class, + "Can't load hashes: %[exception]s", + ex + ); + hashes = CommitHashesMap.FAKES; + } + return hashes; + } ).value(); } } diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java index 1f99afb893..ccc18e7a37 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/BinarizeMojoTest.java @@ -23,6 +23,7 @@ */ package org.eolang.maven; +import com.yegor256.WeAreOnline; import java.io.File; import java.io.IOException; import java.nio.file.Path; @@ -43,6 +44,7 @@ * * @since 0.1 */ +@ExtendWith(WeAreOnline.class) final class BinarizeMojoTest { /** diff --git a/eo-runtime/pom.xml b/eo-runtime/pom.xml index 108d374be8..109e4d764d 100644 --- a/eo-runtime/pom.xml +++ b/eo-runtime/pom.xml @@ -258,68 +258,75 @@ SOFTWARE. - - org.jacoco - jacoco-maven-plugin - - - jacoco-initialize - - prepare-agent - - - - jacoco-check - test - - check - report - - - - - BUNDLE - - - INSTRUCTION - COVEREDRATIO - 0.14 - - - LINE - COVEREDRATIO - 0.13 - - - BRANCH - COVEREDRATIO - 0.03 - - - COMPLEXITY - COVEREDRATIO - 0.08 - - - METHOD - COVEREDRATIO - 0.12 - - - CLASS - MISSEDCOUNT - 1514 - - - - - - - -
+ + jacoco + + + + org.jacoco + jacoco-maven-plugin + + + jacoco-initialize + + prepare-agent + + + + jacoco-check + test + + check + report + + + + + BUNDLE + + + INSTRUCTION + COVEREDRATIO + 0.14 + + + LINE + COVEREDRATIO + 0.13 + + + BRANCH + COVEREDRATIO + 0.03 + + + COMPLEXITY + COVEREDRATIO + 0.08 + + + METHOD + COVEREDRATIO + 0.12 + + + CLASS + MISSEDCOUNT + 1514 + + + + + + + + + + + qulice diff --git a/eo-runtime/src/main/eo/org/eolang/int.eo b/eo-runtime/src/main/eo/org/eolang/int.eo index 07d7261d6e..f52b71c33d 100644 --- a/eo-runtime/src/main/eo/org/eolang/int.eo +++ b/eo-runtime/src/main/eo/org/eolang/int.eo @@ -43,7 +43,7 @@ int x > value! - # Tests that $ ≤ x. + # Tests that $ <= x. [x] > lte not. > @ ^.gt @@ -52,7 +52,7 @@ # Tests that $ > x. [x] > gt /bool - # Tests that $ ≥ x. + # Tests that $ >= x. [x] > gte not. > @ ^.lt From 0a3000bbc4e9fd47af7749d948230d4ff56fa800 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 11:52:22 +0300 Subject: [PATCH 41/58] jtcop simplified config --- eo-maven-plugin/pom.xml | 4 ---- eo-parser/pom.xml | 4 ---- eo-runtime/pom.xml | 14 -------------- 3 files changed, 22 deletions(-) diff --git a/eo-maven-plugin/pom.xml b/eo-maven-plugin/pom.xml index 03b8f255df..474e1629ab 100644 --- a/eo-maven-plugin/pom.xml +++ b/eo-maven-plugin/pom.xml @@ -523,10 +523,6 @@ SOFTWARE. - - com.github.volodya-lombrozo - jtcop-maven-plugin - diff --git a/eo-parser/pom.xml b/eo-parser/pom.xml index adfcc66597..c6ee69c204 100644 --- a/eo-parser/pom.xml +++ b/eo-parser/pom.xml @@ -193,10 +193,6 @@ SOFTWARE. - - com.github.volodya-lombrozo - jtcop-maven-plugin -
diff --git a/eo-runtime/pom.xml b/eo-runtime/pom.xml index 109e4d764d..aa6744a1e3 100644 --- a/eo-runtime/pom.xml +++ b/eo-runtime/pom.xml @@ -341,20 +341,6 @@ SOFTWARE. - - com.github.volodya-lombrozo - jtcop-maven-plugin - - - - check - - - verify - - - - From 972502e133a18515e1b50559171acc62a3785ff6 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 12:05:38 +0300 Subject: [PATCH 42/58] doc --- eo-runtime/src/main/eo/org/eolang/as-phi.eo | 6 +++++- eo-runtime/src/main/eo/org/eolang/bytes.eo | 4 +++- eo-runtime/src/main/eo/org/eolang/cage.eo | 13 ++++++++++--- eo-runtime/src/main/eo/org/eolang/cti.eo | 8 ++++++-- eo-runtime/src/main/eo/org/eolang/dataized.eo | 4 ++++ eo-runtime/src/main/eo/org/eolang/error.eo | 2 +- eo-runtime/src/main/eo/org/eolang/false.eo | 2 +- eo-runtime/src/main/eo/org/eolang/float.eo | 3 ++- eo-runtime/src/main/eo/org/eolang/int.eo | 3 ++- eo-runtime/src/main/eo/org/eolang/malloc.eo | 14 +++++++++++--- eo-runtime/src/main/eo/org/eolang/seq.eo | 3 ++- eo-runtime/src/main/eo/org/eolang/string.eo | 3 ++- eo-runtime/src/main/eo/org/eolang/switch.eo | 8 +++++--- eo-runtime/src/main/eo/org/eolang/true.eo | 2 +- eo-runtime/src/main/eo/org/eolang/try.eo | 6 +++--- eo-runtime/src/main/eo/org/eolang/while.eo | 2 +- 16 files changed, 59 insertions(+), 24 deletions(-) diff --git a/eo-runtime/src/main/eo/org/eolang/as-phi.eo b/eo-runtime/src/main/eo/org/eolang/as-phi.eo index de76942c31..8e1a9ef3b2 100644 --- a/eo-runtime/src/main/eo/org/eolang/as-phi.eo +++ b/eo-runtime/src/main/eo/org/eolang/as-phi.eo @@ -26,5 +26,9 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Turns an object into a φ-term. +# Turns an object into a phi-term printable to console. +# +# This object is mostly used for testing/debugging, when it's necessary +# to inspect the structure of an object. The output will omit recursive +# links. [x] > as-phi /string diff --git a/eo-runtime/src/main/eo/org/eolang/bytes.eo b/eo-runtime/src/main/eo/org/eolang/bytes.eo index fb9741a0ee..49733f78d6 100644 --- a/eo-runtime/src/main/eo/org/eolang/bytes.eo +++ b/eo-runtime/src/main/eo/org/eolang/bytes.eo @@ -26,7 +26,9 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Bytes. +# The object encapsulates a chain of bytes, adding a few +# convenient operations to it. Objects like `int`, `string`, +# and `float` encapsulate `bytes`. [] > bytes # Return itself. $ > as-bytes diff --git a/eo-runtime/src/main/eo/org/eolang/cage.eo b/eo-runtime/src/main/eo/org/eolang/cage.eo index 051e216a2a..296c14e9cd 100644 --- a/eo-runtime/src/main/eo/org/eolang/cage.eo +++ b/eo-runtime/src/main/eo/org/eolang/cage.eo @@ -26,9 +26,16 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# This object is doing exactly the same as "memory", but allows -# you to store objects, not only data. In other words, it doesn't -# do dataization when objects are being stored. +# This object is doing exactly the same as `memory`, but allows +# to store objects, not only data. In other words, it doesn't +# do dataization when objects are being stored. Also, when the +# encaged object is retrieved, not the bytes gets out, but the +# object that was put there. +# +# The `cage` object is considered a bad practice in EO and most +# probably will be removed in the next versions of the language. +# It is not recommended to use it, unless for debugging and +# transition purposes (from another language to EO). [object] > cage @.self > new diff --git a/eo-runtime/src/main/eo/org/eolang/cti.eo b/eo-runtime/src/main/eo/org/eolang/cti.eo index 1ff64ec448..0794988a00 100644 --- a/eo-runtime/src/main/eo/org/eolang/cti.eo +++ b/eo-runtime/src/main/eo/org/eolang/cti.eo @@ -26,6 +26,10 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Compile Time Instruction. -# Make possible to highlight deprecated methods. +# Compile Time Instruction (CTI). +# +# The object may be used to add compile time information to +# other objects. This mechanism is somehow similar to annotations in, +# for example, Java and C#. For example, the object makes it possible +# to highlight deprecated methods. delegate > [delegate level message] > cti diff --git a/eo-runtime/src/main/eo/org/eolang/dataized.eo b/eo-runtime/src/main/eo/org/eolang/dataized.eo index d430da0b65..069ee9d5de 100644 --- a/eo-runtime/src/main/eo/org/eolang/dataized.eo +++ b/eo-runtime/src/main/eo/org/eolang/dataized.eo @@ -30,13 +30,16 @@ # `bytes`. # The object is used as implementation of caching syntax (`!`). # The next two lines of code behaves identically: +# # ``` # some-object > cached! # (dataized some-object).as-bytes > cached # ``` +# # Dataization is a process of retrieving data (bytes) from an object, by taking its \Delta # attribute. # An example of usage: +# # ``` # # Some 64+ characters comment should be here. # [] > foo @@ -48,6 +51,7 @@ # (dataized foo).as-bytes > result # result is 00-00-00-00-00-00-00-05 # result.as-int > f # f is 5 # ``` +# # Here, when `.as-bytes` is taken, the `dataized` dataizes (takes `bytes`) from the object `foo` # and returns them. The `.as-bytes` is used to prevent double dataization. [target] > dataized /bytes diff --git a/eo-runtime/src/main/eo/org/eolang/error.eo b/eo-runtime/src/main/eo/org/eolang/error.eo index 75b1993cb7..5c99918d8c 100644 --- a/eo-runtime/src/main/eo/org/eolang/error.eo +++ b/eo-runtime/src/main/eo/org/eolang/error.eo @@ -30,5 +30,5 @@ # due to an error. Just make a copy of it with any encapsulated object. # The first attempt to dataize it will lead to runtime error and program # termination. The only way to catch such an error is by using -# the object 'try'. +# the `try` object. [message] > error /? diff --git a/eo-runtime/src/main/eo/org/eolang/false.eo b/eo-runtime/src/main/eo/org/eolang/false.eo index 915d4859b9..bd05a739a2 100644 --- a/eo-runtime/src/main/eo/org/eolang/false.eo +++ b/eo-runtime/src/main/eo/org/eolang/false.eo @@ -26,7 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# False. +# The object is a FALSE boolean state. [] > false 00- > @ true > not diff --git a/eo-runtime/src/main/eo/org/eolang/float.eo b/eo-runtime/src/main/eo/org/eolang/float.eo index 6c40b9db97..4b4140aada 100644 --- a/eo-runtime/src/main/eo/org/eolang/float.eo +++ b/eo-runtime/src/main/eo/org/eolang/float.eo @@ -26,7 +26,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Float. +# The `float` object is an abstraction of a 64-bit floating-point number that +# internally is a chain of eight bytes. [as-bytes] > float as-bytes > @ diff --git a/eo-runtime/src/main/eo/org/eolang/int.eo b/eo-runtime/src/main/eo/org/eolang/int.eo index f52b71c33d..21bbabec57 100644 --- a/eo-runtime/src/main/eo/org/eolang/int.eo +++ b/eo-runtime/src/main/eo/org/eolang/int.eo @@ -26,7 +26,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Integer. +# The `int` object is an abstraction of a 64-bit signed integer that +# internally is a chain of eight bytes. [as-bytes] > int as-bytes > @ diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index c48c93ffd2..cbda5fb7ba 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -29,31 +29,40 @@ # Storage of data in memory. # # There are two ways of usage `malloc`: -# 1. of size: +# +# First, when the size of required memory block is known upfront: +# # ``` # malloc.of # 8 # [m] # m.put 10 > @ # ``` +# # Here, the first argument is a size of allocated block in memory, the second argument # is the scope where memory block is available for reading and writing. When `malloc.of` is # dataized it dataizes the scope, take the data from the block in memory, clears the block and # returns the data. So there's no need for end-user to care about clearing memory after allocation. # -# 2. for object +# Second, when the size is not known upfront, but there exists +# an object ready to be dataized and placed into the memory block +# (the size of the block will be equal to the amount of bytes +# produced by the dataization of the object): +# # ``` # malloc.for # "Hello world!" # [m] # m.put "Hello, Jeff!" > @ # ``` +# # Here, the first argument is an object which will be dataized, then a block in memory of given data # size is allocated and the data is written to the block. The second argument is the same scope as # in the p.1. # # The void attribute in the scope object is memory-block object which provides API to write and read # data to the memory. +# # ``` # malloc.of # 8 # allocate 8 bytes length block in memory @@ -68,7 +77,6 @@ # m.id # get identifier of the block # m.@ # the same as m.get # ``` -# Malloc. [] > malloc # Allocates block in memory for given `object`. After allocation the provided object is dataized # and the data are written into memory. diff --git a/eo-runtime/src/main/eo/org/eolang/seq.eo b/eo-runtime/src/main/eo/org/eolang/seq.eo index 2d98f86746..b1f66aea66 100644 --- a/eo-runtime/src/main/eo/org/eolang/seq.eo +++ b/eo-runtime/src/main/eo/org/eolang/seq.eo @@ -26,5 +26,6 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Dataizes all provided steps and returns the last one. +# The object, when being dataized, dataizes all provided +# "steps" (except the last one) and returns the last one. [steps] > seq /? diff --git a/eo-runtime/src/main/eo/org/eolang/string.eo b/eo-runtime/src/main/eo/org/eolang/string.eo index fa789dbeb3..70aa675231 100644 --- a/eo-runtime/src/main/eo/org/eolang/string.eo +++ b/eo-runtime/src/main/eo/org/eolang/string.eo @@ -26,7 +26,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# String. +# The `string` object is an abstraction of a text string, which +# internally is a chain of bytes. [as-bytes] > string as-bytes > @ diff --git a/eo-runtime/src/main/eo/org/eolang/switch.eo b/eo-runtime/src/main/eo/org/eolang/switch.eo index cb8722675a..b28825feed 100644 --- a/eo-runtime/src/main/eo/org/eolang/switch.eo +++ b/eo-runtime/src/main/eo/org/eolang/switch.eo @@ -26,11 +26,12 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Allow to choose right options according to cases conditions. +# The object allows to choose right options according to cases conditions. # Parameter cases is the array of two dimensional array, which # consist of condition bool value and expected value, if this -# condition is true. -# e.g. +# condition is true. For example: +# +# ``` # switch # * # * @@ -39,6 +40,7 @@ # * # false # "this value will be skipped" +# ``` # # This object returns value of only first truly statement. [cases] > switch diff --git a/eo-runtime/src/main/eo/org/eolang/true.eo b/eo-runtime/src/main/eo/org/eolang/true.eo index 1ca9d1fe1e..1bcc96150b 100644 --- a/eo-runtime/src/main/eo/org/eolang/true.eo +++ b/eo-runtime/src/main/eo/org/eolang/true.eo @@ -26,7 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# True. +# The object is a TRUE boolean state. [] > true 01- > @ false > not diff --git a/eo-runtime/src/main/eo/org/eolang/try.eo b/eo-runtime/src/main/eo/org/eolang/try.eo index c5a9d6909b..be0e8597ea 100644 --- a/eo-runtime/src/main/eo/org/eolang/try.eo +++ b/eo-runtime/src/main/eo/org/eolang/try.eo @@ -27,7 +27,7 @@ +version 0.0.0 # Try, catch and finally. This object helps catch errors created by the -# object 'error'. When being dataized, such objects will crash the problem. -# Decorate them with 'try' and errors will be caught by the 'catch' -# abstract object here and the enclosure of the 'error' will be passed to it. +# `error` object. When being dataized, such objects will crash the problem. +# Decorate them with `try` and errors will be caught by the `catch` +# abstract object here and the enclosure of the `error` will be passed to it. [main catch finally] > try /? diff --git a/eo-runtime/src/main/eo/org/eolang/while.eo b/eo-runtime/src/main/eo/org/eolang/while.eo index 00dd4464d6..c6be0916b7 100644 --- a/eo-runtime/src/main/eo/org/eolang/while.eo +++ b/eo-runtime/src/main/eo/org/eolang/while.eo @@ -26,7 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# While. +# The `while` object is very similar to a loop with a pre-condition. [condition body] > while if. > @ (condition 0).as-bool From 338c8bc292eb2fbb337ea833a00eddc17c136bfc Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 12:07:03 +0300 Subject: [PATCH 43/58] doc --- eo-runtime/src/main/eo/org/eolang/io/stdout.eo | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eo-runtime/src/main/eo/org/eolang/io/stdout.eo b/eo-runtime/src/main/eo/org/eolang/io/stdout.eo index 978c49ef90..90ff25abe0 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/stdout.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/stdout.eo @@ -26,5 +26,12 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Stdout. +# The `stdout` object, when it's being dataized, dataizes its only +# argument and prints everything to the console. For example: +# +# ``` +# [args] > app +# QQ.io.stdout > @ +# "Hello, world!\n" +# ``` [text] > stdout /true From 0b981f62f9a771ad1f7f4c9cd4f1f8b237459b77 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 12:07:29 +0300 Subject: [PATCH 44/58] doc --- eo-runtime/src/main/eo/org/eolang/io/stdin.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-runtime/src/main/eo/org/eolang/io/stdin.eo b/eo-runtime/src/main/eo/org/eolang/io/stdin.eo index 7475123a29..a064c28891 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/stdin.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/stdin.eo @@ -26,7 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Stdin. +# The `stdin` object reads the console. [] > stdin # Consumes only one line from the standard input stream # Dataizes to an error object if there is no line to consume. From d59f0c9b1afd6cade4f1022087468dbfac5bfc52 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 12:08:50 +0300 Subject: [PATCH 45/58] doc --- eo-runtime/src/main/eo/org/eolang/cti.eo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eo-runtime/src/main/eo/org/eolang/cti.eo b/eo-runtime/src/main/eo/org/eolang/cti.eo index 0794988a00..017db8d1a6 100644 --- a/eo-runtime/src/main/eo/org/eolang/cti.eo +++ b/eo-runtime/src/main/eo/org/eolang/cti.eo @@ -31,5 +31,7 @@ # The object may be used to add compile time information to # other objects. This mechanism is somehow similar to annotations in, # for example, Java and C#. For example, the object makes it possible -# to highlight deprecated methods. +# to highlight deprecated methods. EO compiler, when it meets the +# `cli` object, takes its `message` and prints to the log/console +# with the `level` severity level (use `INFO`, `WARN`, or `ERROR`). delegate > [delegate level message] > cti From 676f7ae2641aac7f1e4700c32e42010d970fa8f3 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Tue, 7 May 2024 12:11:10 +0300 Subject: [PATCH 46/58] doc --- eo-runtime/src/main/eo/org/eolang/malloc.eo | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index cbda5fb7ba..016aa90963 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -26,7 +26,9 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +version 0.0.0 -# Storage of data in memory. +# The `malloc` object is an abstraction of a storage of data in heap +# memory. The implementation of `malloc` is platform dependent. It may +# use either OS-level or VM-level memory management mechanism. # # There are two ways of usage `malloc`: # From 281d9edece6c98e12e12ffb38022aaa32ac3669d Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Tue, 7 May 2024 15:01:38 +0300 Subject: [PATCH 47/58] #2979 enable dataization output tests from MainTest --- .../src/test/java/org/eolang/MainTest.java | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/eo-runtime/src/test/java/org/eolang/MainTest.java b/eo-runtime/src/test/java/org/eolang/MainTest.java index a8fdd226a3..540070c882 100644 --- a/eo-runtime/src/test/java/org/eolang/MainTest.java +++ b/eo-runtime/src/test/java/org/eolang/MainTest.java @@ -40,9 +40,6 @@ * Test case for {@link Main}. * * @since 0.1 - * @todo #2931:30min Enable all disabled test in the class. The tests were disabled because object - * tupled-stdout.eo was removed from eo-runtime tests because it wasn't working in CI. - * Need to refactor them and enable */ final class MainTest { @@ -68,13 +65,12 @@ void printsHelp() { } @Test - @Disabled void deliversCleanOutput() { MatcherAssert.assertThat( - AtCompositeTest.TO_ADD_MESSAGE, - MainTest.exec("org.eolang.io.tupled-stdout", "Hello!"), + "Incorrect output when dataizing \"true\" object", + MainTest.exec("org.eolang.true"), Matchers.stringContainsInOrder( - String.format("Hello!%n---%n"), + String.format("%n---%n"), "true", String.format("%n") ) @@ -82,16 +78,14 @@ void deliversCleanOutput() { } @Test - @Disabled void executesJvmFullRun() { MatcherAssert.assertThat( - AtCompositeTest.TO_ADD_MESSAGE, - MainTest.exec("--verbose", "org.eolang.io.tupled-stdout", "Hello, dude!"), + "Incorrect verbose output when dataizing \"false\" object", + MainTest.exec("--verbose", "org.eolang.false"), Matchers.allOf( Matchers.containsString("EOLANG"), - Matchers.containsString("Hello, "), Matchers.containsString("\uD835\uDD3B( "), - Matchers.containsString("string") + Matchers.containsString("false") ) ); } From 3cfb4c1cbd56cc9ac593c8e40d8e0cf0ccfd8728 Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Tue, 7 May 2024 18:48:59 +0300 Subject: [PATCH 48/58] #2978 enabled tests for dataized logs --- eo-runtime/src/test/java/org/eolang/DataizedTest.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/eo-runtime/src/test/java/org/eolang/DataizedTest.java b/eo-runtime/src/test/java/org/eolang/DataizedTest.java index b2f856968f..70f2be7a51 100644 --- a/eo-runtime/src/test/java/org/eolang/DataizedTest.java +++ b/eo-runtime/src/test/java/org/eolang/DataizedTest.java @@ -33,20 +33,16 @@ import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; /** * Test case for {@link Dataized}. * * @since 0.22 - * @todo #2931:30min Enable the disabled tests. The tests were disabled after \rho attribute - * became immutable. Need to find out what's going on and resolve the tests. */ final class DataizedTest { @Test - @Disabled void logsCorrectly() { final Logger log = Logger.getLogger("logsCorrectly"); final Level before = log.getLevel(); @@ -68,7 +64,6 @@ void logsCorrectly() { } @Test - @Disabled void logsWhenException() { final Logger log = Logger.getLogger("logsWhenException"); final Level before = log.getLevel(); @@ -79,7 +74,7 @@ void logsWhenException() { final Phi wrong = new PhIncorrect(Phi.Φ); IntStream.range(0, 5).forEach( i -> Assertions.assertThrows( - IllegalStateException.class, + ExFailure.class, () -> new Dataized(wrong).take(), AtCompositeTest.TO_ADD_MESSAGE ) From 5b1f54a2ca801165d84033191f4f9876e1f2e957 Mon Sep 17 00:00:00 2001 From: Roman Korostinskiy <70313618+c71n93@users.noreply.github.com> Date: Tue, 7 May 2024 18:51:42 +0300 Subject: [PATCH 49/58] #2978 add assertion messages --- eo-runtime/src/test/java/org/eolang/DataizedTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eo-runtime/src/test/java/org/eolang/DataizedTest.java b/eo-runtime/src/test/java/org/eolang/DataizedTest.java index 70f2be7a51..563955d563 100644 --- a/eo-runtime/src/test/java/org/eolang/DataizedTest.java +++ b/eo-runtime/src/test/java/org/eolang/DataizedTest.java @@ -54,7 +54,7 @@ void logsCorrectly() { log.setLevel(before); log.removeHandler(hnd); MatcherAssert.assertThat( - AtCompositeTest.TO_ADD_MESSAGE, + "Expected correct logs for object dataization", logs.get(0).getMessage(), Matchers.allOf( Matchers.containsString("intν"), @@ -76,14 +76,14 @@ void logsWhenException() { i -> Assertions.assertThrows( ExFailure.class, () -> new Dataized(wrong).take(), - AtCompositeTest.TO_ADD_MESSAGE + "Expected failure with ExFailure exception on incorrect object dataization" ) ); new Dataized(new Data.ToPhi(1L), log).take(); log.setLevel(before); log.removeHandler(hnd); MatcherAssert.assertThat( - AtCompositeTest.TO_ADD_MESSAGE, + "Expected correct logs for object dataization", logs.get(0).getMessage(), Matchers.allOf( Matchers.containsString("intν"), From d1c00dd12d8679cceb9e11cf79eb0db945b8c4f5 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 8 May 2024 11:00:28 +0300 Subject: [PATCH 50/58] fix(#3147): lowercased auto generated name --- .../print/samples/auto-named-abstract.yaml | 6 ++- .../java/org/eolang/parser/XeEoListener.java | 2 +- .../org/eolang/parser/xmir-to-eo-reversed.xsl | 36 ++++++----------- .../org/eolang/parser/xmir-to-eo.xsl | 36 ++++++----------- .../catches-conflict-with-auto-name.yaml | 39 +++++++++++++++++++ .../packs/syntax/auto-named-abstract.yaml | 6 +-- .../parser/samples/auto-named-abstract.yaml | 6 ++- 7 files changed, 73 insertions(+), 58 deletions(-) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-conflict-with-auto-name.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/auto-named-abstract.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/auto-named-abstract.yaml index ac6e12d32c..40d72dda5b 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/auto-named-abstract.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/auto-named-abstract.yaml @@ -27,10 +27,12 @@ origin: | straight: | x > first - [] >> + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-2-4 5 > five reversed: | x > first - [] >> + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-2-4 5 > five diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index caff598261..3e5f680c1c 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1103,7 +1103,7 @@ public void enterAname(final EoParser.AnameContext ctx) { .prop( "name", String.format( - "OBJ-%d-%d", + "auto-named-attr-at-%d-%d", ctx.getStart().getLine(), ctx.getStart().getCharPositionInLine() ) diff --git a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl index 384ce66222..e892888fb8 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl @@ -22,7 +22,7 @@ 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. --> - + - - - - @@ -113,7 +108,7 @@ SOFTWARE. - + @@ -133,24 +128,15 @@ SOFTWARE. - - - - >> - - - - > - - - ! - - - / - - - - + > + + + ! + + + / + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl index bd253cfd3e..d4cced47f5 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl @@ -22,7 +22,7 @@ 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. --> - + - - - - @@ -129,7 +124,7 @@ SOFTWARE. - + @@ -149,24 +144,15 @@ SOFTWARE. - - - - >> - - - - > - - - ! - - - / - - - - + > + + + ! + + + / + + diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-conflict-with-auto-name.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-conflict-with-auto-name.yaml new file mode 100644 index 0000000000..96bfc65a42 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/catches/catches-conflict-with-auto-name.yaml @@ -0,0 +1,39 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. +--- +# @todo #3147:30min Make duplicate names catcher more powerful. This test pack is disabled now +# because names duplication is not caught here. It happens because of "duplicate-names.xsl" thinks +# that abstract objects in the tests are on the different levels. Syntactically they are, but +# semantically they're not. So we need to make this duplicate catcher more powerful, enable the +# test by removing "skip: true" line and make sure it works. +skip: true +xsls: + - /org/eolang/parser/critical-errors/duplicate-names.xsl +tests: + - /program/errors[count(error)=1] +eo: | + # This is the default 64+ symbols comment in front of abstract object. + [] > main + x > f + [] >> + # This is the default 64+ symbols comment in front of abstract object. + [] > auto-named-attr-at-4-6 diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/auto-named-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/auto-named-abstract.yaml index 44bc44988f..b7e614f90d 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/auto-named-abstract.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/auto-named-abstract.yaml @@ -23,9 +23,9 @@ xsls: [ ] tests: - //errors[count(error)=0] - - //o[@abstract and starts-with(@name,'OBJ-') and o[@name='five']] - - //o[@abstract and starts-with(@name,'OBJ-') and o[@name='ten']] - - //o[@abstract and starts-with(@name,'OBJ-') and @as='hello' and o[@name='eleven']] + - //o[@abstract and @name='auto-named-attr-at-2-4' and o[@name='five']] + - //o[@abstract and @name='auto-named-attr-at-4-2' and o[@name='ten']] + - //o[@abstract and @name='auto-named-attr-at-8-10' and @as='hello' and o[@name='eleven']] eo: | x > first [] >> diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/auto-named-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/auto-named-abstract.yaml index ac6e12d32c..40d72dda5b 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/auto-named-abstract.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/auto-named-abstract.yaml @@ -27,10 +27,12 @@ origin: | straight: | x > first - [] >> + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-2-4 5 > five reversed: | x > first - [] >> + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-2-4 5 > five From 5e662dfe143c8e3379a0ac650312330d1a602124 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 8 May 2024 11:17:46 +0300 Subject: [PATCH 51/58] fix(#3147): jtcop --- eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java | 1 + eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java | 1 + eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java | 1 + eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java | 1 + 4 files changed, 4 insertions(+) diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java index 72db6b68ec..0d0e9f6115 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOcageTest.java @@ -58,6 +58,7 @@ * Test cases for {@link EOcage}. * @since 0.19 */ +@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass") final class EOcageTest { @Test void encagesViaApplication() { diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java index 62ce9f9625..4aadb7a3e1 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOintTest.java @@ -40,6 +40,7 @@ * @since 0.1 * @checkstyle TypeNameCheck (4 lines) */ +@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass") public final class EOintTest { @Test diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java index ff561d58b1..4be0a3f4a3 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOmallocTest.java @@ -46,6 +46,7 @@ * * @since 0.1 */ +@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass") public final class EOmallocTest { @Test void freesMemory() { diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java index dc1c9d5646..013708b75e 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOtupleEOatTest.java @@ -50,6 +50,7 @@ * @since 0.1 * @checkstyle TypeNameCheck (2 lines) */ +@SuppressWarnings("JTCOP.RuleAllTestsHaveProductionClass") final class EOtupleEOatTest { @Test From 33465e6516c0e40421feb1e41f7ba26bfeb7db95 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 8 May 2024 15:36:11 +0300 Subject: [PATCH 52/58] fix(#3147): finish? --- .../main/java/org/eolang/maven/PhiMojo.java | 29 +++----- .../maven/phi/decapitalize-auto-named.xsl | 61 ---------------- .../maven/packs/decapitalize-auto-named.yaml | 71 ------------------- .../org/eolang/maven/phi/yaml/auto-named.yaml | 4 +- .../src/main/java/org/eolang/AtSetRho.java | 9 +-- 5 files changed, 12 insertions(+), 162 deletions(-) delete mode 100644 eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl delete mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java index 6c580f65ae..639ba36302 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java @@ -27,9 +27,8 @@ import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; import com.yegor256.xsline.Shift; -import com.yegor256.xsline.TrClasspath; +import com.yegor256.xsline.StClasspath; import com.yegor256.xsline.TrDefault; -import com.yegor256.xsline.TrJoined; import com.yegor256.xsline.Train; import com.yegor256.xsline.Xsline; import java.io.File; @@ -63,15 +62,7 @@ public final class PhiMojo extends SafeMojo { /** * Extension of the file where we put phi-calculus expression (.phi). */ - static final String EXT = "phi"; - - /** - * Sheets for converting to phi. - */ - private static final String[] SHEETS = { - "/org/eolang/maven/phi/decapitalize-auto-named.xsl", - "/org/eolang/maven/phi/to-phi.xsl", - }; + public static final String EXT = "phi"; /** * The directory where to take xmir files for translation from. @@ -107,18 +98,12 @@ public final class PhiMojo extends SafeMojo { @Override public void exec() { final Home home = new HmBase(this.phiOutputDir); - final Train def; + final Train train; if (this.phiOptimize) { - def = new ParsingTrain(); + train = new ParsingTrain(); } else { - def = new TrDefault<>(); + train = new TrDefault<>(); } - final Train train = new TrJoined<>( - def, - new TrClasspath<>( - PhiMojo.SHEETS - ).back() - ); final int count = new SumOf( new Threads<>( Runtime.getRuntime().availableProcessors(), @@ -189,7 +174,9 @@ count, new Rel(this.phiInputDir), new Rel(this.phiOutputDir) */ private static String translated(final Train train, final XML xmir) throws ImpossibleToPhiTranslationException { - final XML translated = new Xsline(train).pass(xmir); + final XML translated = new Xsline( + train.with(new StClasspath("/org/eolang/maven/phi/to-phi.xsl")) + ).pass(xmir); Logger.debug(PhiMojo.class, "XML after translation to phi:\n%s", translated); final List phi = translated.xpath("phi/text()"); if (phi.isEmpty()) { diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl deleted file mode 100644 index cb17e1d71c..0000000000 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/decapitalize-auto-named.xsl +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml deleted file mode 100644 index d8481b19fc..0000000000 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/packs/decapitalize-auto-named.yaml +++ /dev/null @@ -1,71 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2016-2024 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. ---- -xsls: - - /org/eolang/parser/errors/not-empty-atoms.xsl - - /org/eolang/parser/critical-errors/duplicate-names.xsl - - /org/eolang/parser/errors/many-free-attributes.xsl - - /org/eolang/parser/errors/broken-aliases.xsl - - /org/eolang/parser/errors/duplicate-aliases.xsl - - /org/eolang/parser/errors/global-nonames.xsl - - /org/eolang/parser/errors/same-line-names.xsl - - /org/eolang/parser/errors/self-naming.xsl - - /org/eolang/parser/cti/cti-adds-errors.xsl - - /org/eolang/parser/add-refs.xsl - - /org/eolang/parser/wrap-method-calls.xsl - - /org/eolang/parser/expand-qqs.xsl - - /org/eolang/parser/add-probes.xsl - - /org/eolang/parser/vars-float-up.xsl - - /org/eolang/parser/add-refs.xsl - - /org/eolang/parser/warnings/sparse-decoration.xsl - - /org/eolang/parser/warnings/unsorted-metas.xsl - - /org/eolang/parser/warnings/incorrect-architect.xsl - - /org/eolang/parser/warnings/incorrect-home.xsl - - /org/eolang/parser/warnings/incorrect-version.xsl - - /org/eolang/parser/expand-aliases.xsl - - /org/eolang/parser/resolve-aliases.xsl - - /org/eolang/parser/add-refs.xsl - - /org/eolang/parser/add-default-package.xsl - - /org/eolang/parser/errors/broken-refs.xsl - - /org/eolang/parser/errors/unknown-names.xsl - - /org/eolang/parser/errors/noname-attributes.xsl - - /org/eolang/parser/critical-errors/duplicate-names.xsl - - /org/eolang/parser/warnings/duplicate-metas.xsl - - /org/eolang/parser/warnings/mandatory-package-meta.xsl - - /org/eolang/parser/warnings/mandatory-home-meta.xsl - - /org/eolang/parser/warnings/mandatory-version-meta.xsl - - /org/eolang/parser/warnings/correct-package-meta.xsl - - /org/eolang/parser/warnings/prohibited-package.xsl - - /org/eolang/parser/errors/external-weak-typed-atoms.xsl - - /org/eolang/parser/errors/unused-aliases.xsl - - /org/eolang/parser/warnings/unit-test-without-phi.xsl - - /org/eolang/parser/explicit-data.xsl - - /org/eolang/parser/const-to-dataized.xsl - - /org/eolang/parser/set-locators.xsl - - /org/eolang/maven/phi/decapitalize-auto-named.xsl -tests: - - //o[@abstract and @name='obj-2-4' and count(o)=1] - - //o[@base='obj-2-4'] -eo: | - x - [] >> - 5 > five diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml index 7dbf930adf..2dd7574533 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/yaml/auto-named.yaml @@ -31,9 +31,9 @@ phi: |- ⟦ object ↦ ⟦ first ↦ Φ.org.eolang.x( - α0 ↦ ξ.obj-4-6 + α0 ↦ ξ.auto-named-attr-at-4-6 ), - obj-4-6 ↦ ⟦ + auto-named-attr-at-4-6 ↦ ⟦ b ↦ Φ.org.eolang.bytes( Δ ⤍ 01- ) diff --git a/eo-runtime/src/main/java/org/eolang/AtSetRho.java b/eo-runtime/src/main/java/org/eolang/AtSetRho.java index 5bcafc3c63..96c2223081 100644 --- a/eo-runtime/src/main/java/org/eolang/AtSetRho.java +++ b/eo-runtime/src/main/java/org/eolang/AtSetRho.java @@ -54,13 +54,8 @@ final class AtSetRho extends AtEnvelope { Phi ret = attr.get(); if (!name.equals(Attr.RHO)) { final Phi copy = ret.copy(); - try { - if (copy.put(Attr.RHO, rho)) { - ret = copy; - } - } catch (Exception e) { - System.out.println(e); - throw e; + if (copy.put(Attr.RHO, rho)) { + ret = copy; } } return ret; From a71be6d8fc665216667c65ecb9c739dbe2fde25d Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 8 May 2024 15:45:12 +0300 Subject: [PATCH 53/58] fix(#3147): param --- eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java b/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java index b298fe95b8..52e7bcda6a 100644 --- a/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java +++ b/eo-runtime/src/test/java/EOorg/EOeolang/EOfailed.java @@ -27,6 +27,7 @@ */ package EOorg.EOeolang; +import com.jcabi.log.Logger; import org.eolang.PhDefault; /** @@ -47,5 +48,6 @@ public final class EOfailed extends PhDefault { */ public EOfailed(final String arg) { super(); + Logger.info(this, "EOfailed %s", arg); } } From 0fb245c6af4be4a19f635da7ec9b3a8cdb257f05 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 9 May 2024 16:17:11 +0300 Subject: [PATCH 54/58] #3177: Added wide test of rust-plus --- .../src/test/eo/org/eolang/rust-tests.eo | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo index 6b349b563a..39a064dfe7 100644 --- a/eo-runtime/src/test/eo/org/eolang/rust-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/rust-tests.eo @@ -471,3 +471,71 @@ org. Q 00-00-00-00-00-00-00-02 + +# This is the default 64+ symbols comment in front of named abstract object. +[] > rust-unwrapped-plus + int. > a + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-05 + int. > b + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-0A + rust. > plus + eolang. + org. + Q + string.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 75-73-65-20-65-6F-3A-3A-50-6F-72-74-61-6C-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3B-0A-75-73-65-20-65-6F-3A-3A-65-6F-5F-65-6E-75-6D-3A-3A-45-4F-3A-3A-7B-45-4F-49-6E-74-7D-3B-0A-75-73-65-20-62-79-74-65-6F-72-64-65-72-3A-3A-7B-42-69-67-45-6E-64-69-61-6E-2C-20-52-65-61-64-42-79-74-65-73-45-78-74-7D-3B-0A-0A-70-75-62-20-66-6E-20-66-6F-6F-28-70-6F-72-74-61-6C-3A-20-26-6D-75-74-20-50-6F-72-74-61-6C-29-20-2D-3E-20-4F-70-74-69-6F-6E-3C-45-4F-3E-20-7B-0A-20-20-6C-65-74-20-61-20-3D-20-70-6F-72-74-61-6C-2E-66-69-6E-64-28-22-24-2E-5E-2E-61-22-29-3F-3B-0A-20-20-6C-65-74-20-62-79-74-65-73-5F-61-20-3D-20-70-6F-72-74-61-6C-2E-64-61-74-61-69-7A-65-28-61-29-3F-3B-0A-20-20-6C-65-74-20-61-20-3D-20-62-79-74-65-73-5F-61-2E-61-73-5F-73-6C-69-63-65-28-29-2E-72-65-61-64-5F-69-36-34-3A-3A-3C-42-69-67-45-6E-64-69-61-6E-3E-28-29-2E-6F-6B-28-29-3F-3B-0A-0A-20-20-6C-65-74-20-62-20-3D-20-70-6F-72-74-61-6C-2E-66-69-6E-64-28-22-24-2E-5E-2E-62-22-29-3F-3B-0A-20-20-6C-65-74-20-62-79-74-65-73-5F-62-20-3D-20-70-6F-72-74-61-6C-2E-64-61-74-61-69-7A-65-28-62-29-3F-3B-0A-20-20-6C-65-74-20-62-20-3D-20-62-79-74-65-73-5F-62-2E-61-73-5F-73-6C-69-63-65-28-29-2E-72-65-61-64-5F-69-36-34-3A-3A-3C-42-69-67-45-6E-64-69-61-6E-3E-28-29-2E-6F-6B-28-29-3F-3B-0A-20-20-70-72-69-6E-74-6C-6E-21-28-22-73-75-6D-20-35-20-2B-20-31-30-20-3D-20-7B-7D-22-2C-20-61-20-2B-20-62-29-3B-0A-20-20-53-6F-6D-65-28-45-4F-49-6E-74-28-61-20-2B-20-62-29-29-0A-7D + auto-named-attr-at-327-6.:1 + $ + tuple.:2 + eolang. + org. + Q + empty.:0 + tuple. + eolang. + org. + Q + string.:1 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 62-79-74-65-6F-72-64-65-72-3A-31-2E-34-2E-33 + eq. > @ + plus. + $ + int.:0 + eolang. + org. + Q + bytes.:0 + eolang. + org. + Q + 00-00-00-00-00-00-00-0F + # This is the default 64+ symbols comment in front of named abstract object. + [] > auto-named-attr-at-327-6 From 527921d28dc334d6cc6dc4ced0bcefee48835303 Mon Sep 17 00:00:00 2001 From: levBagryansky <28lev11@gmail.com> Date: Thu, 9 May 2024 16:18:16 +0300 Subject: [PATCH 55/58] #3177: check wide form in add-rust --- .../org/eolang/maven/add_rust/add_rust.xsl | 4 +- ...> detects-rust-code-with-wide-string.yaml} | 0 ...ts-rust-dependencies-with-wide-string.yaml | 275 ++++++++++++++++++ 3 files changed, 277 insertions(+), 2 deletions(-) rename eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/{detects-rust-with-wide-string.yaml => detects-rust-code-with-wide-string.yaml} (100%) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl index 5386392bfc..c6b22b0b62 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/add_rust/add_rust.xsl @@ -42,10 +42,10 @@ SOFTWARE.
- + - + diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-code-with-wide-string.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-with-wide-string.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-code-with-wide-string.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml new file mode 100644 index 0000000000..84fa4a5095 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/binarize/add_rust/detects-rust-dependencies-with-wide-string.yaml @@ -0,0 +1,275 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 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. +--- +sheets: + - /org/eolang/maven/add_rust/add_rust.xsl +document: + + + + + + + + + + + 00 00 00 00 00 00 00 05 + + + + + + + + 00 00 00 00 00 00 00 0A + + + + + + + + + + + + + + 75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 75 73 65 20 62 79 74 65 6F 72 64 65 72 3A 3A 7B 42 69 67 45 6E 64 69 61 6E 2C 20 52 65 61 64 42 79 74 65 73 45 78 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 6C 65 74 20 61 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 61 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 61 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 61 29 3F 3B 0A 20 20 6C 65 74 20 61 20 3D 20 62 79 74 65 73 5F 61 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 0A 20 20 6C 65 74 20 62 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 62 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 62 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 62 29 3F 3B 0A 20 20 6C 65 74 20 62 20 3D 20 62 79 74 65 73 5F 62 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 73 75 6D 20 35 20 2B 20 31 30 20 3D 20 7B 7D 22 2C 20 61 20 2B 20 62 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 61 20 2B 20 62 29 29 0A 7D + + + + + + + + + + + + + + + + + + + + + + + + + + 62 79 74 65 6F 72 64 65 72 3A 31 2E 34 2E 33 + + + + + + + + + + + + + + 00 00 00 00 00 00 00 0F + + + + + + + +asserts: + - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-unwrapped-plus.plus.α0' and @code='75 73 65 20 65 6F 3A 3A 50 6F 72 74 61 6C 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3B 0A 75 73 65 20 65 6F 3A 3A 65 6F 5F 65 6E 75 6D 3A 3A 45 4F 3A 3A 7B 45 4F 49 6E 74 7D 3B 0A 75 73 65 20 62 79 74 65 6F 72 64 65 72 3A 3A 7B 42 69 67 45 6E 64 69 61 6E 2C 20 52 65 61 64 42 79 74 65 73 45 78 74 7D 3B 0A 0A 70 75 62 20 66 6E 20 66 6F 6F 28 70 6F 72 74 61 6C 3A 20 26 6D 75 74 20 50 6F 72 74 61 6C 29 20 2D 3E 20 4F 70 74 69 6F 6E 3C 45 4F 3E 20 7B 0A 20 20 6C 65 74 20 61 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 61 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 61 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 61 29 3F 3B 0A 20 20 6C 65 74 20 61 20 3D 20 62 79 74 65 73 5F 61 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 0A 20 20 6C 65 74 20 62 20 3D 20 70 6F 72 74 61 6C 2E 66 69 6E 64 28 22 24 2E 5E 2E 62 22 29 3F 3B 0A 20 20 6C 65 74 20 62 79 74 65 73 5F 62 20 3D 20 70 6F 72 74 61 6C 2E 64 61 74 61 69 7A 65 28 62 29 3F 3B 0A 20 20 6C 65 74 20 62 20 3D 20 62 79 74 65 73 5F 62 2E 61 73 5F 73 6C 69 63 65 28 29 2E 72 65 61 64 5F 69 36 34 3A 3A 3C 42 69 67 45 6E 64 69 61 6E 3E 28 29 2E 6F 6B 28 29 3F 3B 0A 20 20 70 72 69 6E 74 6C 6E 21 28 22 73 75 6D 20 35 20 2B 20 31 30 20 3D 20 7B 7D 22 2C 20 61 20 2B 20 62 29 3B 0A 20 20 53 6F 6D 65 28 45 4F 49 6E 74 28 61 20 2B 20 62 29 29 0A 7D'] + - /program/rusts/rust[@code_loc='Φ.org.eolang.rust-unwrapped-plus.plus.α0']/dependencies/dependency[@name="62 79 74 65 6F 72 64 65 72 3A 31 2E 34 2E 33"] From 3e0b669d1f8f974cc327b709490e9bb618e831c4 Mon Sep 17 00:00:00 2001 From: rultor <8086956+rultor@users.noreply.github.com> Date: Thu, 9 May 2024 18:23:17 +0000 Subject: [PATCH 56/58] new version in README --- eo-maven-plugin/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo-maven-plugin/README.md b/eo-maven-plugin/README.md index 30c603ee48..dd18d85466 100644 --- a/eo-maven-plugin/README.md +++ b/eo-maven-plugin/README.md @@ -35,7 +35,7 @@ create a file `pom.xml` with this content (it's just a sample): org.eolang eo-maven-plugin - 0.37.0 + 0.38.0 @@ -156,7 +156,7 @@ execution within `eo-maven-plugin/pom.xml`: ... maven-invoker-plugin - 0.37.0 + 0.38.0 true true From 59de95d0be1426f2a7697c0188239482fa309644 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 08:12:44 +0000 Subject: [PATCH 57/58] fix(deps): update dependency org.aspectj:aspectjrt to v1.9.22.1 --- eo-maven-plugin/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eo-maven-plugin/pom.xml b/eo-maven-plugin/pom.xml index 474e1629ab..a592915741 100644 --- a/eo-maven-plugin/pom.xml +++ b/eo-maven-plugin/pom.xml @@ -78,7 +78,7 @@ SOFTWARE. org.aspectj aspectjrt - 1.9.22 + 1.9.22.1 net.sf.saxon From 88b3b4bf5e7cf54efd3a116aac7a41cc35ce54ef Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 08:55:55 +0000 Subject: [PATCH 58/58] chore(deps): update dependency com.qulice:qulice-maven-plugin to v0.23.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4860fbfa11..54986e51ca 100644 --- a/pom.xml +++ b/pom.xml @@ -369,7 +369,7 @@ SOFTWARE. com.qulice qulice-maven-plugin - 0.22.2 + 0.23.0 checkstyle:/src/site/resources/.*