From 87f7994f6b9f50fe8e113f1f65be9e0dd68e16d7 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Fri, 24 Jan 2025 13:06:29 +0300 Subject: [PATCH 01/12] bug(#3845): first try --- .../main/java/org/eolang/parser/EoSyntax.java | 3 +- .../org/eolang/parser/parse/roll-bases.xsl | 148 ++++++++++++++++++ .../eolang/parser/parse/stars-to-tuples.xsl | 11 +- 3 files changed, 156 insertions(+), 6 deletions(-) create mode 100644 eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl diff --git a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java index c63dc3ce56..1ac158dbd0 100644 --- a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java @@ -63,7 +63,8 @@ public final class EoSyntax implements Syntax { "/org/eolang/parser/parse/resolve-before-star.xsl", "/org/eolang/parser/parse/wrap-method-calls.xsl", "/org/eolang/parser/parse/const-to-dataized.xsl", - "/org/eolang/parser/parse/stars-to-tuples.xsl" + "/org/eolang/parser/parse/stars-to-tuples.xsl", + "/org/eolang/parser/parse/roll-bases.xsl" ).back() ) ); diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl new file mode 100644 index 0000000000..9a84d0030a --- /dev/null +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl @@ -0,0 +1,148 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl index ec8066fed4..4e697fbd77 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl @@ -34,11 +34,12 @@ SOFTWARE. Into the next one without @star: - - - - - + + + + + + From 8a34e1a66ac5dc85a73d28c9360b1af8d83561e1 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Sun, 26 Jan 2025 20:53:27 +0300 Subject: [PATCH 02/12] bug(#3845): move --- .../main/java/org/eolang/maven/TrShaking.java | 14 ++--- .../org/eolang/maven}/shake/add-probes.xsl | 0 .../eolang/maven}/shake/blank-xsd-schema.xsl | 0 .../org/eolang/maven}/shake/clean-up.xsl | 0 .../eolang/maven}/shake/constant-folding.xsl | 0 .../eolang/maven}/shake/cti-adds-errors.xsl | 0 .../org/eolang/maven}/shake/remove-noise.xsl | 0 .../org/eolang/maven}/shake/set-locators.xsl | 0 .../java/org/eolang/maven/ShakeMojoTest.java | 27 ++++++++++ .../maven/shake-packs}/add-locators.yaml | 0 .../maven/shake-packs}/add-locs-with-dot.yml | 0 .../eolang/maven/shake-packs}/add-locs.yml | 0 .../shake-packs}/add-probes-to-empty.yaml | 0 .../eolang/maven/shake-packs}/add-probes.yaml | 0 .../maven/shake-packs}/adds-no-probes.yaml | 0 .../maven/shake-packs}/cti-adds-error.yaml | 0 .../maven/shake-packs}/cti-adds-warning.yaml | 0 .../maven/shake-packs}/sets-blank-schema.yaml | 0 .../main/java/org/eolang/parser/EoSyntax.java | 54 +++++++++++++++++-- .../java/org/eolang/parser/XePhiListener.java | 8 +-- .../src/main/java/org/eolang/parser/Xmir.java | 16 +++--- .../resources/org/eolang/parser/_datas.xsl | 6 +-- .../{shake => parse}/add-default-package.xsl | 11 +++- .../parser/{shake => parse}/build-fqns.xsl | 0 .../{shake => parse}/expand-aliases.xsl | 0 .../parser/{shake => parse}/expand-qqs.xsl | 15 ++---- .../parser/{shake => parse}/explicit-data.xsl | 22 ++++---- .../{shake => parse}/resolve-aliases.xsl | 0 ...fore-star.xsl => resolve-before-stars.xsl} | 0 .../org/eolang/parser/parse/roll-bases.xsl | 24 ++++----- .../parser/{shake => parse}/vars-float-up.xsl | 0 .../eolang/parser/parse/wrap-method-calls.xsl | 4 +- .../java/org/eolang/parser/EoSyntaxTest.java | 8 +-- .../eo-packs/parse/additional-brackets.yaml | 6 ++- .../adds-default-package.yaml | 0 .../parser/eo-packs/parse/all-data-types.yaml | 31 ++++++----- .../parser/eo-packs/parse/anonymous.yaml | 4 +- .../parser/eo-packs/parse/before-star.yaml | 8 +-- .../parse/bound-reversed-application.yaml | 8 +-- .../eo-packs/{shake => parse}/build-fqn.yaml | 0 .../eo-packs/parse/const-to-dataized.yaml | 10 ++-- .../eo-packs/parse/escape-sequences.yaml | 2 +- .../eo-packs/{shake => parse}/expand-qqs.yaml | 0 .../{shake => parse}/expands-aliases.yaml | 0 .../{shake => parse}/explicit-data.yaml | 0 .../{shake => parse}/float-atom-vars.yaml | 0 .../float-vars-with-pre-methods.yaml | 0 .../eo-packs/{shake => parse}/float-vars.yaml | 0 .../parser/eo-packs/parse/full-syntax.yaml | 8 +-- .../parser/eo-packs/parse/line-numbers.yaml | 6 +-- .../parser/eo-packs/parse/move-voids-up.yaml | 3 +- .../parser/eo-packs/parse/onlyphi-bound.yaml | 14 ++--- .../parser/eo-packs/parse/parsed-data.yaml | 16 +++--- .../parser/eo-packs/parse/pre-method.yaml | 6 +-- .../eo-packs/parse/preserves-spaces.yaml | 6 +-- .../eo-packs/{shake => parse}/recursion.yaml | 0 .../{shake => parse}/resolves-aliases.yaml | 0 .../eo-packs/parse/scope-before-method.yaml | 2 +- .../skips-fqns-in-primitives.yaml | 0 59 files changed, 207 insertions(+), 132 deletions(-) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/add-probes.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/blank-xsd-schema.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/clean-up.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/constant-folding.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/cti-adds-errors.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/remove-noise.xsl (100%) rename {eo-parser/src/main/resources/org/eolang/parser => eo-maven-plugin/src/main/resources/org/eolang/maven}/shake/set-locators.xsl (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/add-locators.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/add-locs-with-dot.yml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/add-locs.yml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/add-probes-to-empty.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/add-probes.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/adds-no-probes.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/cti-adds-error.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/cti-adds-warning.yaml (100%) rename {eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake => eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs}/sets-blank-schema.yaml (100%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/add-default-package.xsl (87%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/build-fqns.xsl (100%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/expand-aliases.xsl (100%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/expand-qqs.xsl (81%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/explicit-data.xsl (86%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/resolve-aliases.xsl (100%) rename eo-parser/src/main/resources/org/eolang/parser/parse/{resolve-before-star.xsl => resolve-before-stars.xsl} (100%) rename eo-parser/src/main/resources/org/eolang/parser/{shake => parse}/vars-float-up.xsl (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/adds-default-package.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/build-fqn.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/expand-qqs.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/expands-aliases.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/explicit-data.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/float-atom-vars.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/float-vars-with-pre-methods.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/float-vars.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/recursion.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/resolves-aliases.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-packs/{shake => parse}/skips-fqns-in-primitives.yaml (100%) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/TrShaking.java b/eo-maven-plugin/src/main/java/org/eolang/maven/TrShaking.java index 7335b02473..f09b9f7ac1 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/TrShaking.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/TrShaking.java @@ -40,17 +40,9 @@ final class TrShaking extends TrEnvelope { super( new TrFull( new TrClasspath<>( - "/org/eolang/parser/shake/cti-adds-errors.xsl", - "/org/eolang/parser/shake/vars-float-up.xsl", - "/org/eolang/parser/shake/build-fqns.xsl", - "/org/eolang/parser/shake/expand-qqs.xsl", - "/org/eolang/parser/shake/add-probes.xsl", - "/org/eolang/parser/shake/expand-aliases.xsl", - "/org/eolang/parser/shake/resolve-aliases.xsl", - "/org/eolang/parser/shake/add-default-package.xsl", - "/org/eolang/parser/shake/explicit-data.xsl", - "/org/eolang/parser/shake/set-locators.xsl", - "/org/eolang/parser/shake/blank-xsd-schema.xsl" + "/org/eolang/maven/shake/cti-adds-errors.xsl", + "/org/eolang/maven/shake/add-probes.xsl", + "/org/eolang/maven/shake/set-locators.xsl" ).back() ) ); diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/add-probes.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/add-probes.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/blank-xsd-schema.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/blank-xsd-schema.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/blank-xsd-schema.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/blank-xsd-schema.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/clean-up.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/clean-up.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/clean-up.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/clean-up.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/constant-folding.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/constant-folding.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/constant-folding.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/constant-folding.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/cti-adds-errors.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/cti-adds-errors.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/remove-noise.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/remove-noise.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/remove-noise.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/remove-noise.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/set-locators.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/set-locators.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/set-locators.xsl rename to eo-maven-plugin/src/main/resources/org/eolang/maven/shake/set-locators.xsl diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java index acfa36227b..790c7fad16 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java @@ -28,6 +28,7 @@ import com.yegor256.Mktmp; import com.yegor256.MktmpResolver; import com.yegor256.farea.Farea; +import com.yegor256.xsline.TrDefault; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -41,8 +42,14 @@ import net.sf.saxon.TransformerFactoryImpl; import org.cactoos.io.ResourceOf; import org.cactoos.text.TextOf; +import org.eolang.jucs.ClasspathSource; import org.eolang.maven.footprint.Saved; import org.eolang.maven.util.HmBase; +import org.eolang.parser.EoSyntax; +import org.eolang.xax.XtSticky; +import org.eolang.xax.XtStrict; +import org.eolang.xax.XtYaml; +import org.eolang.xax.XtoryMatcher; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.hamcrest.io.FileMatchers; @@ -82,6 +89,26 @@ void shakesSimpleObject(@Mktmp final Path temp) throws Exception { ); } + @Test + @ClasspathSource(value = "org/eolang/maven/shake-packs/", glob = "**.yaml") + void checksShakePacks(final String yaml) { + MatcherAssert.assertThat( + "passed without exceptions", + new XtSticky( + new XtStrict( + new XtYaml( + yaml, + eo -> new EoSyntax( + "scenario", + String.format("%s\n", eo) + ).parsed() + ) + ) + ), + new XtoryMatcher() + ); + } + @Test void skipsAlreadyShaken(@Mktmp final Path temp) throws IOException { final FakeMaven maven = new FakeMaven(temp) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locators.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locators.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locs-with-dot.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locs-with-dot.yml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locs.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-locs.yml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-probes-to-empty.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-probes-to-empty.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/add-probes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/adds-no-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/adds-no-probes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/cti-adds-error.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/cti-adds-error.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/cti-adds-warning.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/cti-adds-warning.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/sets-blank-schema.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/shake/sets-blank-schema.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml diff --git a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java index 1ac158dbd0..704b0d38f5 100644 --- a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java @@ -26,10 +26,13 @@ import com.jcabi.log.Logger; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; +import com.yegor256.xsline.Shift; import com.yegor256.xsline.TrClasspath; +import com.yegor256.xsline.Train; import com.yegor256.xsline.Xsline; import java.io.IOException; import java.util.List; +import java.util.function.Function; import org.antlr.v4.runtime.CommonTokenStream; import org.antlr.v4.runtime.tree.ParseTreeWalker; import org.cactoos.Input; @@ -55,19 +58,26 @@ public final class EoSyntax implements Syntax { /** * Set of optimizations that builds canonical XMIR from parsed EO. */ - private static final Xsline CANONICAL = new Xsline( + private static final Function CANONICAL = new Xsline( new TrFull( new TrClasspath<>( "/org/eolang/parser/parse/move-voids-up.xsl", "/org/eolang/parser/parse/validate-before-stars.xsl", - "/org/eolang/parser/parse/resolve-before-star.xsl", + "/org/eolang/parser/parse/resolve-before-stars.xsl", "/org/eolang/parser/parse/wrap-method-calls.xsl", "/org/eolang/parser/parse/const-to-dataized.xsl", "/org/eolang/parser/parse/stars-to-tuples.xsl", + "/org/eolang/parser/parse/vars-float-up.xsl", + "/org/eolang/parser/parse/build-fqns.xsl", + "/org/eolang/parser/parse/expand-qqs.xsl", + "/org/eolang/parser/parse/expand-aliases.xsl", + "/org/eolang/parser/parse/resolve-aliases.xsl", + "/org/eolang/parser/parse/add-default-package.xsl", + "/org/eolang/parser/parse/explicit-data.xsl", "/org/eolang/parser/parse/roll-bases.xsl" ).back() ) - ); + )::pass; /** * The name of the EO program being parsed, usually the name of @@ -83,6 +93,11 @@ public final class EoSyntax implements Syntax { */ private final Input input; + /** + * Transform XMIR after parsing. + */ + private final Function transform; + /** * Ctor. * @@ -110,6 +125,16 @@ public EoSyntax(final String nme, final String ipt) { this(nme, new InputOf(ipt)); } + /** + * Ctor. + * + * @param nme The name of the EO program being parsed + * @param ipt The EO program to parse + */ + public EoSyntax(final String nme, final String ipt, final Train transform) { + this(nme, new InputOf(ipt), transform); + } + /** * Ctor. * @@ -117,8 +142,29 @@ public EoSyntax(final String nme, final String ipt) { * @param ipt The EO program to parse */ public EoSyntax(final String nme, final Input ipt) { + this(nme, ipt, EoSyntax.CANONICAL); + } + + /** + * Ctor for testing. + * @param nme The name of the EO program being parsed + * @param ipt The EO program to parse + * @param transform Transform XMIR after parsing train + */ + EoSyntax(final String nme, final Input ipt, final Train transform) { + this(nme, ipt, new Xsline(transform)::pass); + } + + /** + * Ctor. + * @param nme The name of the EO program being parsed + * @param ipt The EO program to parse + * @param transform Transform XMIR after parsing function + */ + EoSyntax(final String nme, final Input ipt, Function transform) { this.name = nme; this.input = ipt; + this.transform = transform; } /** @@ -145,7 +191,7 @@ public XML parsed() throws IOException { parser.addErrorListener(eospy); final XeEoListener xel = new XeEoListener(this.name); new ParseTreeWalker().walk(xel, parser.program()); - final XML dom = EoSyntax.CANONICAL.pass( + final XML dom = this.transform.apply( new XMLDocument( new Xembler( new Directives(xel).append(new DrErrors(spy)).append(new DrErrors(eospy)) 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 214b67bf23..10668e58ca 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java @@ -419,7 +419,7 @@ public void exitApplicationsOrDispatches(final PhiParser.ApplicationsOrDispatche @Override public void enterTermination(final PhiParser.TerminationContext ctx) { - this.objects().prop("base", "org.eolang.error").leave(); + this.objects().prop("base", "Q.org.eolang.error").leave(); } @Override @@ -433,7 +433,7 @@ public void enterData(final PhiParser.DataContext ctx) { final Supplier data; final String text = ctx.getText(); if (ctx.FLOAT() != null || ctx.INT() != null) { - base = "org.eolang.number"; + base = "Q.org.eolang.number"; data = new BytesToHex( ByteBuffer .allocate(Double.BYTES) @@ -441,7 +441,7 @@ public void enterData(final PhiParser.DataContext ctx) { .array() ); } else { - base = "org.eolang.string"; + base = "Q.org.eolang.string"; data = new BytesToHex( StringEscapeUtils.unescapeJava( text.substring(1, text.length() - 1) @@ -454,7 +454,7 @@ public void enterData(final PhiParser.DataContext ctx) { ctx.getStart().getLine(), ctx.getStart().getCharPositionInLine() + base.length() + 1 ) - .prop("base", "org.eolang.bytes") + .prop("base", "Q.org.eolang.bytes") .data(data.get()) .leave(); } diff --git a/eo-parser/src/main/java/org/eolang/parser/Xmir.java b/eo-parser/src/main/java/org/eolang/parser/Xmir.java index c2d5755dd6..2e981b2701 100644 --- a/eo-parser/src/main/java/org/eolang/parser/Xmir.java +++ b/eo-parser/src/main/java/org/eolang/parser/Xmir.java @@ -69,7 +69,7 @@ public final class Xmir implements XML { new StEndless( new StClasspath("/org/eolang/parser/print/tuples-to-stars.xsl") ), - new StClasspath("/org/eolang/parser/shake/explicit-data.xsl"), + new StClasspath("/org/eolang/parser/parse/explicit-data.xsl"), new StClasspath("/org/eolang/parser/print/dataized-to-const.xsl"), new StUnhex(), new StClasspath("/org/eolang/parser/print/wrap-data.xsl") @@ -81,13 +81,13 @@ public final class Xmir implements XML { */ private static final Train FOR_PHI = new TrFull( new TrClasspath<>( - "/org/eolang/parser/shake/vars-float-up.xsl", - "/org/eolang/parser/shake/build-fqns.xsl", - "/org/eolang/parser/shake/expand-qqs.xsl", - "/org/eolang/parser/shake/expand-aliases.xsl", - "/org/eolang/parser/shake/resolve-aliases.xsl", - "/org/eolang/parser/shake/add-default-package.xsl", - "/org/eolang/parser/shake/explicit-data.xsl", + "/org/eolang/parser/parse/vars-float-up.xsl", + "/org/eolang/parser/parse/build-fqns.xsl", + "/org/eolang/parser/parse/expand-qqs.xsl", + "/org/eolang/parser/parse/expand-aliases.xsl", + "/org/eolang/parser/parse/resolve-aliases.xsl", + "/org/eolang/parser/parse/add-default-package.xsl", + "/org/eolang/parser/parse/explicit-data.xsl", "/org/eolang/parser/phi/wrap-default-package.xsl" ).back() ); diff --git a/eo-parser/src/main/resources/org/eolang/parser/_datas.xsl b/eo-parser/src/main/resources/org/eolang/parser/_datas.xsl index 6422bf9fd5..61422bd59a 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/_datas.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/_datas.xsl @@ -24,8 +24,8 @@ SOFTWARE. --> - org.eolang.bytes - org.eolang.string - org.eolang.number + Q.org.eolang.bytes + Q.org.eolang.string + Q.org.eolang.number diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/add-default-package.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/add-default-package.xsl similarity index 87% rename from eo-parser/src/main/resources/org/eolang/parser/shake/add-default-package.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/add-default-package.xsl index fbd62b2697..f0a85c664c 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/shake/add-default-package.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/add-default-package.xsl @@ -45,6 +45,15 @@ SOFTWARE. + + + + Q. + + + + + @@ -54,7 +63,7 @@ SOFTWARE. - org.eolang. + Q.org.eolang. diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/build-fqns.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/build-fqns.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/expand-aliases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/expand-aliases.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/expand-qqs.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/expand-qqs.xsl similarity index 81% rename from eo-parser/src/main/resources/org/eolang/parser/shake/expand-qqs.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/expand-qqs.xsl index 7eaa0ab815..cefb0d4724 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/shake/expand-qqs.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/expand-qqs.xsl @@ -31,16 +31,11 @@ SOFTWARE. - .eolang - - - .org - - - Q - - - + + Q.org.eolang + + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/explicit-data.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/explicit-data.xsl similarity index 86% rename from eo-parser/src/main/resources/org/eolang/parser/shake/explicit-data.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/explicit-data.xsl index 6dfbed9d44..ee6e1c40da 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/shake/explicit-data.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/explicit-data.xsl @@ -33,11 +33,11 @@ SOFTWARE. - QQ.string "H" => QQ.string "H" In the level of xmir it looks like: - - + - 22-32 => 22-32 - - - + - + 00 00 00 00 00 00 00 01 => 00 00 00 00 00 00 00 01 @@ -47,7 +47,7 @@ SOFTWARE. - => + => 01 01 @@ -57,7 +57,7 @@ SOFTWARE. - + @@ -67,10 +67,10 @@ SOFTWARE. - + - + @@ -81,7 +81,7 @@ SOFTWARE. - + @@ -91,8 +91,8 @@ SOFTWARE. - - + + @@ -102,7 +102,7 @@ SOFTWARE. - + diff --git a/eo-parser/src/main/resources/org/eolang/parser/shake/resolve-aliases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-aliases.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/shake/resolve-aliases.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/resolve-aliases.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-star.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.xsl similarity index 100% rename from eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-star.xsl rename to eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.xsl diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl index 9a84d0030a..ea343010df 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.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. --> - + - + @@ -66,7 +66,7 @@ SOFTWARE. - + @@ -47,9 +51,9 @@ SOFTWARE. @@ -58,8 +62,8 @@ SOFTWARE. @@ -71,7 +75,7 @@ SOFTWARE. @@ -83,7 +87,22 @@ SOFTWARE. + + + + + + + + + + + @@ -98,7 +117,7 @@ SOFTWARE. diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl index 4e697fbd77..be41f92443 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/stars-to-tuples.xsl @@ -69,7 +69,7 @@ SOFTWARE. - + diff --git a/eo-parser/src/main/resources/org/eolang/parser/print/dataized-to-const.xsl b/eo-parser/src/main/resources/org/eolang/parser/print/dataized-to-const.xsl index cda7ea4cf9..7edf19e614 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/print/dataized-to-const.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/print/dataized-to-const.xsl @@ -28,7 +28,7 @@ SOFTWARE. --> - + diff --git a/eo-parser/src/main/resources/org/eolang/parser/print/tuples-to-stars.xsl b/eo-parser/src/main/resources/org/eolang/parser/print/tuples-to-stars.xsl index 23179e02c4..43712965a1 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/print/tuples-to-stars.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/print/tuples-to-stars.xsl @@ -27,17 +27,24 @@ SOFTWARE. Performs the reverse operation of "/org/eolang/parser/stars-to-tuples.xsl" --> - + + + + + + + - + + - + diff --git a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java index 40e9c6bdab..3a0f846c45 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java @@ -27,7 +27,6 @@ import com.jcabi.matchers.XhtmlMatchers; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; -import com.yegor256.xsline.Shift; import com.yegor256.xsline.TrDefault; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -39,7 +38,7 @@ import org.cactoos.text.TextOf; import org.eolang.jucs.ClasspathSource; import org.eolang.xax.XtSticky; -import org.eolang.xax.XtStrict; +import org.eolang.xax.XtStrictAfter; import org.eolang.xax.XtYaml; import org.eolang.xax.Xtory; import org.eolang.xax.XtoryMatcher; @@ -310,18 +309,36 @@ void checksTypoPacks(final String yaml) { @ParameterizedTest @ClasspathSource(value = "org/eolang/parser/eo-packs/", glob = "**.yaml") - void checksEoPacks(final String yaml) { + void checksEoTransformations(final String yaml) { MatcherAssert.assertThat( "passed without exceptions", new XtSticky( - new XtStrict( + new XtStrictAfter( new XtYaml( yaml, eo -> new EoSyntax( "scenario", String.format("%s\n", eo), new TrDefault<>() - ).parsed() + ).parsed(), + new TrFull() + ) + ) + ), + new XtoryMatcher() + ); + } + + @ParameterizedTest + @ClasspathSource(value = "org/eolang/parser/eo-syntax/", glob = "**.yaml") + void validatesEoSyntax(final String yaml) { + MatcherAssert.assertThat( + "passed without exceptions", + new XtSticky( + new XtSticky( + new XtYaml( + yaml, + eo -> new EoSyntax("scenario", String.format("%s\n", eo)).parsed() ) ) ), diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/adds-default-package.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml similarity index 79% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/adds-default-package.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml index a9ea958788..5bd76b2f29 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/adds-default-package.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml @@ -21,18 +21,16 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-probes.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl - - /org/eolang/parser/shake/add-default-package.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/expand-aliases.xsl + - /org/eolang/parser/parse/resolve-aliases.xsl + - /org/eolang/parser/parse/add-default-package.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=1] - - //o[@base='org.eolang.and' and @line='9'] + - //o[@base='Q.org.eolang.and' and @line='9'] - //o[@base='foo'] - //o[@base='$'] - //o[@base='^'] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqn.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml similarity index 90% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqn.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml index 9622d29cda..2f872b215d 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqn.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml @@ -21,8 +21,10 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/build-fqns.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=3] @@ -31,14 +33,14 @@ asserts: - /program/objects/o[@name='first']/o[@base='stdout' and @name='std']/o[@base='.x']/o[@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@base='.std']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@base='.std']/o[2][@base='.x']/o[1][@base='^'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='number' and @name='x' and text()!=''] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='Q.org.eolang.number' and @name='x' and text()!=''] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.plus']/o[1][@base='.x']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.plus']/o[2][@base='.y']/o[1][@base='.^']/o[1][@base='^'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.std']/o[1][@base='^'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.std']/o[2][@base='qwe'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.third']/o[1][@base='^'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.third']/o[2][@base='.bar']/o[@base='.examples']/o[@base='.org']/o[@base='Q'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='string' and @name='inner'] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='Q.org.eolang.string' and @name='inner'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='.inner' and @name='outer']/o[1][@base='^'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='.inner' and @name='self']/o[1][@base='$'] input: |- diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/const-to-dataized.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/const-to-dataized.yaml index 5ecb7377eb..1d8dd13a29 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/const-to-dataized.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/const-to-dataized.yaml @@ -20,11 +20,14 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- -sheets: [ ] +sheets: + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl asserts: - - //o[@base='.as-bytes' and @line and @pos and @name='x' and o[@base='Q.org.eolang.dataized' and o[@base='Q.org.eolang.number' and not(@name)]]] - - //o[@base='.as-bytes' and @line and @pos and @name='m' and o[@base='Q.org.eolang.dataized' and o[@base='$.m-3']]] - - //o[@base='.as-bytes' and @line and @pos and @name='num']/o[@base='Q.org.eolang.dataized']/o[@base='Q.org.eolang.number' and o[text()!='']] + - //o[@base='.as-bytes' and @line and @pos and @name='x' and o[@base='Q.org.eolang.dataized' and o[@base='number' and not(@name)]]] + - //o[@base='.as-bytes' and @line and @pos and @name='m' and o[@base='Q.org.eolang.dataized' and o[@base='m-3']]] + - //o[@base='.as-bytes' and @line and @pos and @name='num']/o[@base='Q.org.eolang.dataized']/o[@base='Q.org.eolang.number' and text()!=''] - //o[@base='.as-bytes' and @line and @pos and @name='bts']/o[@base='Q.org.eolang.dataized']/o[@base='Q.org.eolang.bytes' and text()='2A-'] - //o[@name='m-3' and o[@base='.as-bytes' and @line and @pos and @name='z' and o[@base='Q.org.eolang.dataized' and o[@base='.o' and not(@name) and count(o)=1]]]] - //objects[count(//o[@const])=0] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expands-aliases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml similarity index 94% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expands-aliases.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml index ff47a7cedb..9b7919a4c5 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expands-aliases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml @@ -21,7 +21,8 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/expand-aliases.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/expand-aliases.xsl asserts: - /program[not(errors)] - //meta[head='alias' and tail='scanner org.eolang.txt.scanner' and part[1]='scanner' and part[2]='org.eolang.txt.scanner'] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-qqs.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-qqs.yaml index b1f2bc0446..c9fad5a68c 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-qqs.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-qqs.yaml @@ -21,13 +21,12 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/expand-qqs.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/expand-qqs.xsl asserts: - /program[not(errors)] - //objects[count(.//o[starts-with(@base, 'QQ')])=0] - - //objects[count(.//o[starts-with(@base, 'Q')])=1] - - //objects[count(.//o[contains(@base, '.org')])=1] - - //objects[count(.//o[contains(@base, '.eolang')])=1] + - //objects[count(.//o[starts-with(@base, 'Q')])=3] - //metas[count(.//meta[head/text()='alias']/*[text()[starts-with(., 'QQ')]])=0] - //metas[count(.//meta[head/text()='alias']/*[text()[starts-with(., 'Q.org.eolang.txt.sprintfQQ')]])=2] input: | diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/explicit-data.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/explicit-data.yaml index c82b7a8bdf..e9383acc27 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/explicit-data.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/explicit-data.yaml @@ -21,18 +21,21 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/stars-to-tuples.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/add-default-package.xsl + - /org/eolang/parser/parse/explicit-data.xsl asserts: - /program[not(errors)] - - //o[@base='org.eolang.number' and @name='first' and o[@base='org.eolang.bytes' and text()='40-45-00-00-00-00-00-00']] - - //o[@base='org.eolang.number' and @name='bts' and o[@base='org.eolang.bytes' and text()='11-21']] - - //o[@base='org.eolang.number' and @name='second' and o[@base='org.eolang.bytes' and text()='40-36-33-33-33-33-33-33']] - - //o[@base='org.eolang.bytes' and @name='fourth' and not(o) and text()='11-21'] - - //o[@base='.string' and @name='str' and count(o)=2 and o[last() and @base='org.eolang.bytes' and text()='48-65-79']] - - //o[@base='org.eolang.bytes' and @name='bt' and count(o)=0 and text()='A2-'] - - //o[@base='.with']/o[@base='.with']/o[@base='.with']/o[@base='org.eolang.number']/o[@base='org.eolang.bytes' and text()='3F-F0-00-00-00-00-00-00'] + - //o[@base='Q.org.eolang.number' and @name='first' and o[@base='Q.org.eolang.bytes' and text()='40-45-00-00-00-00-00-00']] + - //o[@base='Q.org.eolang.number' and @name='bts' and o[@base='Q.org.eolang.bytes' and text()='11-21']] + - //o[@base='Q.org.eolang.number' and @name='second' and o[@base='Q.org.eolang.bytes' and text()='40-36-33-33-33-33-33-33']] + - //o[@base='Q.org.eolang.bytes' and @name='fourth' and not(o) and text()='11-21'] + - //o[@base='.string' and @name='str' and count(o)=2 and o[last() and @base='Q.org.eolang.bytes' and text()='48-65-79']] + - //o[@base='Q.org.eolang.bytes' and @name='bt' and count(o)=0 and text()='A2-'] + - //o[@base='.with']/o[@base='.with']/o[@base='.with']/o[@base='Q.org.eolang.number']/o[@base='Q.org.eolang.bytes' and text()='3F-F0-00-00-00-00-00-00'] input: | 42 > first number 11-21 > bts diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-atom-vars.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-atom.yaml similarity index 93% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-atom-vars.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-atom.yaml index ea1478ef93..3f803b6e2b 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-atom-vars.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-atom.yaml @@ -21,8 +21,8 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl asserts: - /program/objects[not(o[@atom and @base])] - /program/objects[not(o[@atom and o[@base]])] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-vars.yaml similarity index 89% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-vars.yaml index d45ef7adb6..c4067872c3 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-up-vars.yaml @@ -21,20 +21,20 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=3] - - //o[@base='.as-bytes' and @name='t' and @line='8' and o[@base='org.eolang.dataized']] - - //objects[count(.//o[@base='string'])=1] + - //o[@base='.as-bytes' and @name='t' and @line='8' and o[@base='Q.org.eolang.dataized']] + - //objects[count(.//o[@base='Q.org.eolang.string'])=1] - //o[@name='y']/o[@name='t'] - //o[@name='y']/o[@name='oops'] - //o[@name='last'] - //objects[count(//o[@name='oops'])=1] - //o[@name='aaa'] - //o[@name='ooo'] - - //o[@name='mm' and @base='number'] + - //o[@name='mm' and @base='Q.org.eolang.number'] - //o[@base='mm'] input: | # No comments. diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars-with-pre-methods.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars-with-pre-methods.yaml index c59f1cea70..a6e893c96f 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars-with-pre-methods.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/float-vars-with-pre-methods.yaml @@ -21,7 +21,8 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/vars-float-up.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl asserts: - //o[@base='.a' and @name='one' and count(o)=1] - //o[@base='.b' and @name='two' and count(o)=1] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/move-voids-up.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/move-voids-up.yaml index d1ff751379..57bb0bdf5f 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/move-voids-up.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/move-voids-up.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/move-voids-up.xsl + - /org/eolang/parser/parse/move-voids-up.xsl asserts: - /program[not(errors)] - /program/objects/o[@name='foo' and o[@name='x']/following-sibling::o[@name='@']] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolves-aliases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml similarity index 86% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolves-aliases.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml index 9dbbf10d50..a6237495f0 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolves-aliases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml @@ -21,12 +21,11 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/expand-aliases.xsl + - /org/eolang/parser/parse/resolve-aliases.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=1] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/skips-fqns-in-primitives.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/skips-fqns-in-primitives.yaml index 2cf85919ca..074fac7287 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/skips-fqns-in-primitives.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/skips-fqns-in-primitives.yaml @@ -21,13 +21,16 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/build-fqns.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/build-fqns.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=3] - - /program/objects/o[@name='number']/o[@base='number' and @name='self' and text()!=''] - - /program/objects/o[@name='bytes']/o[@base='bytes' and @name='self' and text()!=''] - - /program/objects/o[@name='string']/o[@base='string' and @name='self' and text()!=''] + - /program/objects/o[@name='number']/o[@base='Q.org.eolang.number' and @name='self' and text()!=''] + - /program/objects/o[@name='bytes']/o[@base='Q.org.eolang.bytes' and @name='self' and text()!=''] + - /program/objects/o[@name='string']/o[@base='Q.org.eolang.string' and @name='self' and text()!=''] input: |- +package org.eolang diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/tuples.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/stars-to-tuples.yaml similarity index 73% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/tuples.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/stars-to-tuples.yaml index e447635235..655fcc9a55 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/tuples.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/stars-to-tuples.yaml @@ -20,31 +20,33 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- -sheets: [ ] +sheets: + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/stars-to-tuples.xsl asserts: - //objects[count(o)=7] - //objects[count(//o[@star])=0] # first - - //o[@base='.empty' and @line=1 and @name='xs']/o[@base='tuple' and not(@name)] + - //o[@base='.empty' and @line=1 and @name='xs']/o[@base='Q.org.eolang.tuple' and not(@name)] # second - - //o[@base='.with' and @line=2 and @name='xl']/o[@base='.empty']/o[@base='tuple'] - - //o[@base='.with' and @line=2 and @name='xl']/o[@base='number'] + - //o[@base='.with' and @line=2 and @name='xl']/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] + - //o[@base='.with' and @line=2 and @name='xl']/o[@base='Q.org.eolang.number'] # third - - //o[@base='.with' and @line=3 and not(@name)]/o[@base='.with']/o[@base='.empty']/o[@base='tuple'] - - //o[@base='.with' and @line=3 and not(@name)]/o[@base='.with']/o[@base='number'] - - //o[@base='.with' and @line=3 and not(@name)]/o[@base='number'] + - //o[@base='.with' and @line=3 and not(@name)]/o[@base='.with']/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] + - //o[@base='.with' and @line=3 and not(@name)]/o[@base='.with']/o[@base='Q.org.eolang.number'] + - //o[@base='.with' and @line=3 and not(@name)]/o[@base='Q.org.eolang.number'] # fourth - - //o[@base='.empty' and @line=4]/o[@base='.empty']/o[@base='tuple'] + - //o[@base='.empty' and @line=4]/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] # fifth - - //o[@base='.with' and @line=5 and not(@name)]/o[@base='.with']/o[@base='.with']/o[@base='.empty']/o[@base='tuple'] + - //o[@base='.with' and @line=5 and not(@name)]/o[@base='.with']/o[@base='.with']/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] - //o[@base='.with' and @line=5 and not(@name)]/o[@base='.with']/o[@base='.with']/o[@base='.c'] - //o[@base='.with' and @line=5 and not(@name)]/o[@base='.with']/o[@base='.f'] - //o[@base='.with' and @line=5 and not(@name)]/o[@base='.i'] # sixth - - //o[@base='.elements']/o[@base='arr']/o[@base='.empty']/o[@base='tuple'] + - //o[@base='.elements']/o[@base='arr']/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] # seventh - //o[@base='.reduced']/o[@base='list'] - - //o[@base='.reduced']/o[@base='.empty']/o[@base='tuple'] + - //o[@base='.reduced']/o[@base='.empty']/o[@base='Q.org.eolang.tuple'] - //o[@base='.reduced']/o[not(@base)]/o[@base='∅' and @name='x'] input: | * > xs diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/before-star.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml similarity index 70% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/before-star.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml index a53b159691..7e6a19ec4e 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/before-star.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/validate-resolve-before-stars.yaml @@ -21,14 +21,15 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/validate-before-stars.xsl - - /org/eolang/parser/resolve-before-stars.xsl + - /org/eolang/parser/parse/validate-before-stars.xsl + - /org/eolang/parser/parse/resolve-before-stars.xsl asserts: - /program/errors/error[@line='3' and @severity='error'] - - /program/objects//o[@name='first' and count(o)=1]/o[@base='.with' and count(o)=2] - - /program/objects//o[@name='second' and count(o)=2]/o[position()=2 and @base='.with' and count(o)=2] - - /program/objects//o[@name='third' and count(o)=3]/o[position()=3 and @base='Q.org.eolang.tuple.empty.with' and count(o)=1] - - /program/objects//o[@name='fourth' and count(o)=2]/o[@base='Q.org.eolang.sprintf' and count(o)=1]/o[@base='.with' and count(o)=2] + - //o[@name='first' and count(o)=1]/o[@base='Q.org.eolang.tuple' and @star and count(o)=2] + - //o[@name='second' and count(o)=2]/o[position()=2 and @base='Q.org.eolang.tuple' and @star and count(o)=2] + - //o[@name='third' and count(o)=3]/o[position()=3 and @base='Q.org.eolang.tuple' and @star and count(o)=1] + - //o[@name='fourth' and count(o)=2]/o[@base='sprintf' and count(o)=1]/o[@base='Q.org.eolang.tuple' and @star and count(o)=2] + - //o[@name='fourth']/o[@base='Q.org.eolang.tuple' and @star and count(o)=1] - /program/objects[count(//o[@before-star])=0] input: | # No comments. diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wraps-methods.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wrap-method-calls.yaml similarity index 93% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wraps-methods.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wrap-method-calls.yaml index e43e686018..6859e1e50d 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wraps-methods.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/wrap-method-calls.yaml @@ -20,7 +20,8 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- -sheets: [ ] +sheets: + - /org/eolang/parser/parse/wrap-method-calls.xsl asserts: - /program[not(errors)] - /program/objects[count(o)=1] @@ -29,7 +30,7 @@ asserts: - //o[@base='.foo' and count(./o)=1] - //o[@base='.trim' and count(./o)=2] - //o[@base='.trim']/o[1][@base='.get'] - - //o[@base='.trim']/o[2][@base='number'] + - //o[@base='.trim']/o[2][@base='Q.org.eolang.number'] - //o[@base='a' and @name='xxx'] - //o[@base='.f2' and not(@name)] input: | diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/dataized-to-const.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/dataized-to-const.yaml index 94dd7e3984..0dc254132e 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/dataized-to-const.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/dataized-to-const.yaml @@ -21,20 +21,29 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl + - /org/eolang/parser/parse/move-voids-up.xsl + - /org/eolang/parser/parse/validate-before-stars.xsl + - /org/eolang/parser/parse/resolve-before-stars.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/stars-to-tuples.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/build-fqns.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/expand-aliases.xsl + - /org/eolang/parser/parse/resolve-aliases.xsl + - /org/eolang/parser/parse/add-default-package.xsl + - /org/eolang/parser/parse/explicit-data.xsl + - /org/eolang/parser/parse/roll-bases.xsl - /org/eolang/parser/print/dataized-to-const.xsl asserts: - - //o[@base='org.eolang.x' and @const and @name='first'] - - //o[@base='.as-bytes' and @name='second']/o[@base='org.eolang.dataized'] - - //o[@base='org.eolang.a' and @const and @name='third']/o[@base='org.eolang.b'] + - //o[@base='Q.org.eolang.x' and @const and @name='first'] + - //o[@base='Q.org.eolang.dataized.as-bytes' and @name='second'] + - //o[@base='Q.org.eolang.a' and @const and @name='third']/o[@base='Q.org.eolang.b'] - //o[@name='fourth-1' and not(@base)] - - //o[@base='.fourth-1' and @name='fourth' and @const] - - //o[@base='org.eolang.number' and @name='fifths' and @const]/o[@base='org.eolang.bytes' and text()!=''] - - //o[@base='org.eolang.bytes' and @name='sixth' and @const and text()='2A-'] + - //o[@base='$.fourth-1' and @name='fourth' and @const] + - //o[@base='Q.org.eolang.number' and @name='fifths' and @const]/o[@base='Q.org.eolang.bytes' and text()!=''] + - //o[@base='Q.org.eolang.bytes' and @name='sixth' and @const and text()='2A-'] input: | # No comments. [] > foo diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/tuples-to-stars.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/tuples-to-stars.yaml index b9510c9b21..60f596e7df 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/tuples-to-stars.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/print/tuples-to-stars.yaml @@ -21,13 +21,25 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/print/tuples-to-stars.xsl - - /org/eolang/parser/print/tuples-to-stars.xsl + - /org/eolang/parser/parse/move-voids-up.xsl + - /org/eolang/parser/parse/validate-before-stars.xsl + - /org/eolang/parser/parse/resolve-before-stars.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/stars-to-tuples.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/build-fqns.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/expand-aliases.xsl + - /org/eolang/parser/parse/resolve-aliases.xsl + - /org/eolang/parser/parse/add-default-package.xsl + - /org/eolang/parser/parse/explicit-data.xsl + - /org/eolang/parser/parse/roll-bases.xsl - /org/eolang/parser/print/tuples-to-stars.xsl - /org/eolang/parser/print/tuples-to-stars.xsl - /org/eolang/parser/print/tuples-to-stars.xsl asserts: - - /program/objects/o[@name='foo']/o[@base='tuple' and @star and count(o)=3 and count(o[@star]=0)] + - /program/objects/o[@name='foo']/o[@base='Q.org.eolang.tuple' and @star and count(o)=3 and count(o[@star]=0)] input: | +package test diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/additional-brackets.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/additional-brackets.yaml similarity index 75% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/additional-brackets.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/additional-brackets.yaml index 5ae4a5d3d7..90aa7f8cea 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/additional-brackets.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/additional-brackets.yaml @@ -23,11 +23,10 @@ sheets: [ ] asserts: - /program[not(errors)] - - //o[@base='number']/following-sibling::o[@base='.times' and @method] - - //o[@base='.times']/o[@base='number' and text()='40-00-00-00-00-00-00-00' and position()=1] - - //o[@base='.times']/o[@base='number' and text()='3F-F0-00-00-00-00-00-00' and position()=2] - - //o[@base='.times']/o[@base='number' and position()=2]/o[@base='.plus' and @method] - - //o[@base='.plus' and @method]/o[@base="other" and o[@base='.value' and @method]] + - //o[@base='.times']/o[@base='Q.org.eolang.number' and @pos=2] + - //o[@base='.times']/o[@base='Q.org.eolang.number' and @pos=10] + - //o[@base='.times']/o[@base='.plus']/o[@base='Q.org.eolang.number']/o[@base='Q.org.eolang.bytes'] + - //o[@base='.times']/o[@base='.plus']/o[@base='Q.org.eolang.other.value'] input: | +home https://github.com/objectionary/eo +package org.eolang.priority diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/all-data-types.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/all-data-types.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/all-data-types.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/all-data-types.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/anonymous-more.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonymous-more.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/anonymous-more.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonymous-more.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/anonymous.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonymous.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/anonymous.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonymous.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/auto-named-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-named-abstract.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/auto-named-abstract.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-named-abstract.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/bool-tests-straight.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/bool-tests-straight.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/bool-tests-straight.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/bool-tests-straight.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/bound-reversed-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/bound-reversed-application.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/bound-reversed-application.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/bound-reversed-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/empty-vs-free.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/empty-vs-free.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/empty-vs-free.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/empty-vs-free.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/escape-sequences.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/escape-sequences.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/escape-sequences.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/escape-sequences.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/full-syntax.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/full-syntax.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/full-syntax.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/full-syntax.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/has-comment.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/has-comment.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/has-comment.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/has-comment.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/leap-year.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/leap-year.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/leap-year.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/leap-year.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/line-numbers.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/line-numbers.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/line-numbers.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/line-numbers.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/numbers.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/numbers.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/numbers.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/numbers.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/onlyphi-bound.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/onlyphi-bound.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/onlyphi-bound.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/onlyphi-bound.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/parsed-data.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/parsed-data.yaml similarity index 95% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/parsed-data.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/parsed-data.yaml index 379b6b2810..4035d83f86 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/parsed-data.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/parsed-data.yaml @@ -25,8 +25,8 @@ asserts: - //o[@name='i1' and o[text()='40-45-00-00-00-00-00-00']] - //o[@name='i2' and o[text()='40-72-F0-00-00-00-00-00']] - //o[@name='f1' and o[text()='40-09-21-CA-C0-83-12-6F']] - - //o[@name='b1' and not(text())]] - - //o[@name='b2' and not(text())]] + - //o[@name='b1' and not(text())] + - //o[@name='b2' and not(text())] - //o[@name='s1' and o[text()='48-69-2C-20-E5-A4-A7-E5-AE-B6-21']] - //o[@name='s2' and o[text()='42-79-65-2C-20-E5-A4-A7-E5-AE-B6-21']] - //o[@name='s3' and o[text()='41-00-01-09-0A']] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/pre-method.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/pre-method.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/pre-method.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/pre-method.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/preserves-spaces.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/preserves-spaces.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/preserves-spaces.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/preserves-spaces.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/recursion.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml similarity index 88% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/recursion.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml index c62c7fa897..35e322f2cb 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/recursion.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml @@ -20,14 +20,11 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- -sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl +sheets: [ ] asserts: - /program[not(errors)] - //o[@name='f' and @line='8'] - - //o[@base='.f']/o[@base='^'] + - //o[@base='^.f'] input: | +home https://github.com/objectionary/eo +package test diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/redundant-parentheses.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/redundant-parentheses.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/redundant-parentheses.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/redundant-parentheses.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scope-before-method.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scope-before-method.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scope-before-method.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scope-before-method.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-double-scope.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-double-scope.yaml similarity index 92% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-double-scope.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-double-scope.yaml index 9dadb2927c..2ca72383df 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-double-scope.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-double-scope.yaml @@ -22,9 +22,9 @@ --- sheets: [ ] asserts: - - //o[@base='foo' and count(o)=2] - - //o[@base='bar' and count(o)=2] - - //o[@base='foobar' and count(o)=2] + - //o[@base='$.foo' and count(o)=2] + - //o[@base='$.bar' and count(o)=2] + - //o[@base='$.foobar' and count(o)=2] input: | # No comments. [] > aliases diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-nested.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-nested.yaml similarity index 89% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-nested.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-nested.yaml index 258b15fc6c..3658d1b831 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-nested.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-nested.yaml @@ -22,9 +22,9 @@ --- sheets: [ ] asserts: - - //o[@base='foo' and count(o)=2] - - //o[@base='bar' and count(o)=2] - - //o[@base='foobar' and count(o)=2 and o[@base='foo' and count(o)=2]] + - //o[@base='$.foo' and count(o)=2] + - //o[@base='$.bar' and count(o)=2] + - //o[@base='$.foobar' and count(o)=2 and o[@base='$.foo' and count(o)=2]] input: | # No comments. [] > aliases diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-with-doubled-methods.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-with-doubled-methods.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-with-doubled-methods.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-with-doubled-methods.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-with-nested-methods.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-with-nested-methods.yaml similarity index 88% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-with-nested-methods.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-with-nested-methods.yaml index 05f9f2e2e0..90519a329d 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes-with-nested-methods.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes-with-nested-methods.yaml @@ -22,9 +22,8 @@ --- sheets: [ ] asserts: - - //o[@base='.with' and count(o)=3]/o[@base='foobar'] - - //o[@base='.with' and count(o)=2]/o[@base='.with' and count(o)=3]/o[@base='foobar'] - - //o[@base='.with' and count(o)=2]/o[@base='.with' and count(o)=2]/o[@base='.with' and count(o)=3]/o[@base='foobar'] + - //o[@base='.with' and count(o)=2]/o[@base='$.foobar.with'] + - //o[@base='.with' and count(o)=2]/o[@base='.with' and count(o)=2]/o[@base='$.foobar.with'] input: | # No comments. [] > aliases diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/scopes.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/scopes.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/simple.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/simple.yaml similarity index 89% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/simple.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/simple.yaml index bee5e3b3d1..a307d3f419 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/simple.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/simple.yaml @@ -27,10 +27,9 @@ asserts: - /program[@version != ''] - /program[@time != ''] - /program/objects - - //o[not(@name) and @base='a'] - - //o[@base='a' and @line='3'] - - //o[@base='b-друг' and @line='4'] - - //o[@base='c4-5' and @line='5'] + - //o[@base='Q.org.eolang.a' and not(@name) and @line='3'] + - //o[@base='Q.org.eolang.b-друг' and @line='4'] + - //o[@base='Q.org.eolang.c4-5' and @line='5'] input: | +package test diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/space-between.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml similarity index 92% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/space-between.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml index 99ffe3cc28..f0bf36b269 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/space-between.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml @@ -23,8 +23,7 @@ sheets: [ ] asserts: - /program[not(errors)] - - //o[@base='.plus']/o[@base='.a']/o[@base='^'] - - //o[@base='.plus']/o[@base='.b']/o[@base='^'] + - //o[@base='^.a.plus' and @name='@']/o[@base='^.b'] input: | +home https://github.com/objectionary/eo +package org.eolang.priority diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/text-block.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/text-block.yaml similarity index 80% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/text-block.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/text-block.yaml index 90d0036c8c..5047d3ca5a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/text-block.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/text-block.yaml @@ -22,10 +22,10 @@ --- sheets: [ ] asserts: - - //o[@base='string' and text()='48-69-2C-20-74-68-65-72-65-0A-41-64-69-C3-B3-73'] - - //o[@base='string' and text()='66-69-72-73-74-0A-20-73-65-63-6F-6E-64'] - - //o[@base='string' and text()='74-68-69-72-64'] - - //o[@base='string' and text()='66-6F-72-74-68'] + - //o[@base='Q.org.eolang.string' and o[text()='48-69-2C-20-74-68-65-72-65-0A-41-64-69-C3-B3-73']] + - //o[@base='Q.org.eolang.string' and o[text()='66-69-72-73-74-0A-20-73-65-63-6F-6E-64']] + - //o[@base='Q.org.eolang.string' and o[text()='74-68-69-72-64']] + - //o[@base='Q.org.eolang.string' and o[text()='66-6F-72-74-68']] input: | # Two lines """ diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/unicode.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/unicode.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/unicode.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/unicode.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/vertical-methods-in-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/vertical-methods-in-application.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/vertical-methods-in-application.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/vertical-methods-in-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/vmethod-after-formation.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/vmethod-after-formation.yaml similarity index 89% rename from eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/vmethod-after-formation.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/vmethod-after-formation.yaml index c2278fd919..2b6795c1b8 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/vmethod-after-formation.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/vmethod-after-formation.yaml @@ -23,7 +23,8 @@ sheets: [ ] asserts: - /program[not(errors)] - - //o[@base='.first']/o[not(@base) and @name='x']/o[@base='y' and @name='@']/o[@base='.second']/o[not(@base) and not(@name)] + - /program/objects/o[@base='Q.x.first'] + - /program/objects/o[@name='x']/o[@base='Q.org.eolang.y']/o[@base='.second']/o[not(@base) and not(@name)] input: | # No comments. [] > x From c4b81cf4fe96b6fbc3cc3db71c037a8e27567b27 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Mon, 27 Jan 2025 17:20:35 +0300 Subject: [PATCH 04/12] bug(#3845): to eo printing fix --- .../main/java/org/eolang/parser/EoSyntax.java | 26 +-- .../main/java/org/eolang/parser/StUnhex.java | 2 +- .../src/main/java/org/eolang/parser/Xmir.java | 12 -- .../parser/parse/resolve-before-stars.xsl | 2 +- .../org/eolang/parser/parse/roll-bases.xsl | 2 +- .../eolang/parser/print/to-eo-reversed.xsl | 167 ------------------ .../org/eolang/parser/print/to-eo.xsl | 73 ++++---- .../src/test/java/benchmarks/XmirBench.java | 5 - .../java/org/eolang/parser/StUnhexTest.java | 18 +- .../test/java/org/eolang/parser/XmirTest.java | 23 +-- .../parser/eo-packs/parse/roll-bases.yaml | 57 ++++++ .../print-packs/yaml/auto-named-abstract.yaml | 14 +- .../eolang/parser/print-packs/yaml/bytes.yaml | 13 +- .../yaml/compares-bool-to-bytes.yaml | 18 +- .../parser/print-packs/yaml/dataless.yaml | 41 +---- .../parser/print-packs/yaml/empty-bytes.yaml | 5 +- .../parser/print-packs/yaml/empty-string.yaml | 21 +-- .../parser/print-packs/yaml/idiomatic.yaml | 42 +---- .../parser/print-packs/yaml/inheritance.yaml | 45 +---- .../parser/print-packs/yaml/just-float.yaml | 9 +- .../print-packs/yaml/multiline-string.yaml | 14 +- .../parser/print-packs/yaml/stars-tuples.yaml | 8 +- .../yaml/string-with-double-spaces.yaml | 5 +- .../eolang/parser/print-packs/yaml/times.yaml | 24 +-- 24 files changed, 160 insertions(+), 486 deletions(-) delete mode 100644 eo-parser/src/main/resources/org/eolang/parser/print/to-eo-reversed.xsl create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml diff --git a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java index 2b40ac56da..704b0d38f5 100644 --- a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java @@ -61,19 +61,19 @@ public final class EoSyntax implements Syntax { private static final Function CANONICAL = new Xsline( new TrFull( new TrClasspath<>( - "/org/eolang/parser/parse/move-voids-up.xsl", // - "/org/eolang/parser/parse/validate-before-stars.xsl", // - "/org/eolang/parser/parse/resolve-before-stars.xsl", // - "/org/eolang/parser/parse/wrap-method-calls.xsl", // - "/org/eolang/parser/parse/const-to-dataized.xsl", // - "/org/eolang/parser/parse/stars-to-tuples.xsl", // - "/org/eolang/parser/parse/vars-float-up.xsl", // - "/org/eolang/parser/parse/build-fqns.xsl", // - "/org/eolang/parser/parse/expand-qqs.xsl", // - "/org/eolang/parser/parse/expand-aliases.xsl", // - "/org/eolang/parser/parse/resolve-aliases.xsl", // - "/org/eolang/parser/parse/add-default-package.xsl", // - "/org/eolang/parser/parse/explicit-data.xsl", // + "/org/eolang/parser/parse/move-voids-up.xsl", + "/org/eolang/parser/parse/validate-before-stars.xsl", + "/org/eolang/parser/parse/resolve-before-stars.xsl", + "/org/eolang/parser/parse/wrap-method-calls.xsl", + "/org/eolang/parser/parse/const-to-dataized.xsl", + "/org/eolang/parser/parse/stars-to-tuples.xsl", + "/org/eolang/parser/parse/vars-float-up.xsl", + "/org/eolang/parser/parse/build-fqns.xsl", + "/org/eolang/parser/parse/expand-qqs.xsl", + "/org/eolang/parser/parse/expand-aliases.xsl", + "/org/eolang/parser/parse/resolve-aliases.xsl", + "/org/eolang/parser/parse/add-default-package.xsl", + "/org/eolang/parser/parse/explicit-data.xsl", "/org/eolang/parser/parse/roll-bases.xsl" ).back() ) diff --git a/eo-parser/src/main/java/org/eolang/parser/StUnhex.java b/eo-parser/src/main/java/org/eolang/parser/StUnhex.java index 8e1759a80c..78c1e55410 100644 --- a/eo-parser/src/main/java/org/eolang/parser/StUnhex.java +++ b/eo-parser/src/main/java/org/eolang/parser/StUnhex.java @@ -148,7 +148,7 @@ private static String undash(final String txt) { */ private static String xpath(final String type) { return String.format( - "(//o[(@base='%s' or @base='org.eolang.%1$s') and(not(@skip)) and o[not(o) and string-length(normalize-space(text()))>0 and (@base='bytes' or @base='org.eolang.bytes')]])[1]", + "(//o[@base='Q.org.eolang.%1$s' and(not(@skip)) and o[1][@base='Q.org.eolang.bytes' and not(o) and string-length(normalize-space(text()))>0]])[1]", type ); } diff --git a/eo-parser/src/main/java/org/eolang/parser/Xmir.java b/eo-parser/src/main/java/org/eolang/parser/Xmir.java index 28b8f542b5..44f0b09beb 100644 --- a/eo-parser/src/main/java/org/eolang/parser/Xmir.java +++ b/eo-parser/src/main/java/org/eolang/parser/Xmir.java @@ -70,7 +70,6 @@ public final class Xmir implements XML { new StEndless( new StClasspath("/org/eolang/parser/print/tuples-to-stars.xsl") ), - new StClasspath("/org/eolang/parser/parse/explicit-data.xsl"), new StClasspath("/org/eolang/parser/print/dataized-to-const.xsl"), new StUnhex(), new StClasspath("/org/eolang/parser/print/wrap-data.xsl") @@ -168,17 +167,6 @@ public String toEO() { ); } - /** - * Converts XMIR to EO, in reverse notation. - * @return EO representation as {@link String} - */ - public String toReversedEO() { - return this.converted( - Xmir.FOR_EO, "/org/eolang/parser/print/to-eo-reversed.xsl", - "eo" - ); - } - /** * Converts XMIR to PHI. * @return PHI representation as {@link String} diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.xsl index 9cf4313213..03120f4231 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/resolve-before-stars.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. --> - + - - - - - - - # No comments. - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dispatching alpha attributes is not supported in EO yet, found: - - - - - . - - - - * - - - - - - - - - - - - - - [ - - - - - - - ] - - - - - : - - - - - - - - - - - > - - - ! - - - / - - - - - - - - - - - - - - diff --git a/eo-parser/src/main/resources/org/eolang/parser/print/to-eo.xsl b/eo-parser/src/main/resources/org/eolang/parser/print/to-eo.xsl index 4afa2d182b..2ad77e8dce 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/print/to-eo.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/print/to-eo.xsl @@ -78,45 +78,24 @@ SOFTWARE. - - - - - - Dispatching alpha attributes is not supported in EO yet, found: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + Dispatching alpha attributes is not supported in EO yet, found: + + + + + + + + + + + + + + + @@ -126,7 +105,21 @@ SOFTWARE. * - + + + + + + + + + + . + + + + + diff --git a/eo-parser/src/test/java/benchmarks/XmirBench.java b/eo-parser/src/test/java/benchmarks/XmirBench.java index b07f3487a2..862bdf98c8 100644 --- a/eo-parser/src/test/java/benchmarks/XmirBench.java +++ b/eo-parser/src/test/java/benchmarks/XmirBench.java @@ -63,11 +63,6 @@ public void xmirToEO() { new Xmir(XmirBench.XMIR).toEO(); } - @Benchmark - public void xmirToReversedEo() { - new Xmir(XmirBench.XMIR).toReversedEO(); - } - @Benchmark public void xmirToPhi() { new Xmir(XmirBench.XMIR).toPhi(); diff --git a/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java b/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java index d6dfb91cdf..90d8b21dfa 100644 --- a/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/StUnhexTest.java @@ -42,7 +42,7 @@ void convertsIntFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "

43-70-2E-4F-30-46-73-2E

" + "

43-70-2E-4F-30-46-73-2E

" ) ), XhtmlMatchers.hasXPaths("//o[text()='72872276393407200']") @@ -55,11 +55,11 @@ void convertsMaxIntFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "

FF-FF-FF-FF-FF-FF-FF-FF

" + "

FF-FF-FF-FF-FF-FF-FF-FF

" ) ), XhtmlMatchers.hasXPaths( - "//o[@base='number' and @skip and o[@base='org.eolang.bytes' and text()!='']]" + "//o[@base='Q.org.eolang.number' and @skip and o[@base='Q.org.eolang.bytes' and text()!='']]" ) ); } @@ -72,8 +72,8 @@ void convertsStringFromHexToEo() { new XMLDocument( String.join( "", - "

41-42-0A-09", - "41-42

" + "

41-42-0A-09", + "41-42

" ) ) ), @@ -90,7 +90,7 @@ void convertsEmptyStringFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "

" + "

" ) ), XhtmlMatchers.hasXPaths( @@ -105,7 +105,7 @@ void convertsStringWithDoubleSpacesFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "7A-0A-20-20-79-0A-20-78" + "7A-0A-20-20-79-0A-20-78" ) ), XhtmlMatchers.hasXPaths( @@ -120,7 +120,7 @@ void convertsNegativeZeroFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "80-00-00-00-00-00-00-00" + "80-00-00-00-00-00-00-00" ) ), XhtmlMatchers.hasXPaths("//o[text()='-0']") @@ -133,7 +133,7 @@ void convertsFloatFromHexToEo() { EoIndentLexerTest.TO_ADD_MESSAGE, new Xsline(new StUnhex()).pass( new XMLDocument( - "

41-42-43-67-AE-CD-3E-FD

" + "

41-42-43-67-AE-CD-3E-FD

" ) ), XhtmlMatchers.hasXPaths( diff --git a/eo-parser/src/test/java/org/eolang/parser/XmirTest.java b/eo-parser/src/test/java/org/eolang/parser/XmirTest.java index c450535716..a0c1fbdb7d 100644 --- a/eo-parser/src/test/java/org/eolang/parser/XmirTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/XmirTest.java @@ -68,23 +68,16 @@ void failsOnDispatchingAlphaAttributes() { @ParameterizedTest @ClasspathSource(value = "org/eolang/parser/print-packs/yaml", glob = "**.yaml") - void printsToEoStraight(final String pack) throws IOException { + void printsToEo(final String pack) throws IOException { final Xtory xtory = new XtSticky(new XtYaml(pack)); + final Xmir xmir = this.asXmir((String) xtory.map().get("origin")); MatcherAssert.assertThat( - "Result EO should be equal to original EO", - this.asXmir((String) xtory.map().get("origin")).toEO(), - Matchers.equalTo(xtory.map().get("straight")) - ); - } - - @ParameterizedTest - @ClasspathSource(value = "org/eolang/parser/print-packs/yaml", glob = "**.yaml") - void printsToEoReversed(final String pack) throws IOException { - final Xtory xtory = new XtSticky(new XtYaml(pack)); - MatcherAssert.assertThat( - "Result EO should be equal to original EO in reverse notation", - this.asXmir((String) xtory.map().get("origin")).toReversedEO(), - Matchers.equalTo(xtory.map().get("reversed")) + String.format( + "Result EO should be equal to original EO, XMIR is:\n%s", + xmir + ), + xmir.toEO(), + Matchers.equalTo(xtory.map().get("printed")) ); } diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml new file mode 100644 index 0000000000..30d685235d --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml @@ -0,0 +1,57 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +sheets: + - /org/eolang/parser/parse/move-voids-up.xsl + - /org/eolang/parser/parse/validate-before-stars.xsl + - /org/eolang/parser/parse/resolve-before-stars.xsl + - /org/eolang/parser/parse/wrap-method-calls.xsl + - /org/eolang/parser/parse/const-to-dataized.xsl + - /org/eolang/parser/parse/stars-to-tuples.xsl + - /org/eolang/parser/parse/vars-float-up.xsl + - /org/eolang/parser/parse/build-fqns.xsl + - /org/eolang/parser/parse/expand-qqs.xsl + - /org/eolang/parser/parse/expand-aliases.xsl + - /org/eolang/parser/parse/resolve-aliases.xsl + - /org/eolang/parser/parse/add-default-package.xsl + - /org/eolang/parser/parse/explicit-data.xsl + - /org/eolang/parser/parse/roll-bases.xsl +asserts: + - //o[@base='$.two.a' and @name='one'] + - //o[@base='$.three.b' and @name='two'] + - //o[@base='Q.org.eolang.c' and @name='three'] + - //o[@base='.with']/o[@base='Q.org.eolang.tuple.empty.with' and o[@base='Q.org.eolang.number']] + - //o[@base='Q.org.eolang.true.if' and count(o)=2] + - //o[@base='.if' and count(o)=3]/o[1][@base='$.x']/o[1][@base='Q.org.eolang.y'] +input: | + # No comment. + [x] > foo + a. > one + b. > two + c > three + * 1 2 > tup + if. true 1 2 > cond + if. > rev + x + y + 2 + 1 diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/auto-named-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/auto-named-abstract.yaml index 10cdc9c9bd..c09f34b66c 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/auto-named-abstract.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/auto-named-abstract.yaml @@ -25,14 +25,10 @@ origin: | [] >> 5 > five -straight: | +printed: | x > first - # No comments. - [] > auto-named-attr-at-2-4 - 5 > five + Q.auto-named-attr-at-2-4 -reversed: | - x > first - # No comments. - [] > auto-named-attr-at-2-4 - 5 > five + # No comments. + [] > auto-named-attr-at-2-4 + 5 > five diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/bytes.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/bytes.yaml index 2b51cb020f..e986f3714d 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/bytes.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/bytes.yaml @@ -31,18 +31,7 @@ origin: | false > b2 -straight: | - EA-EA-EA-EA > xs - - 01- > one - - "hello" > ys - - true > b1 - - false > b2 - -reversed: | +printed: | EA-EA-EA-EA > xs 01- > one diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/compares-bool-to-bytes.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/compares-bool-to-bytes.yaml index df1679f691..d0a9856362 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/compares-bool-to-bytes.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/compares-bool-to-bytes.yaml @@ -26,23 +26,11 @@ origin: | and. > @ true.eq 01- false.eq 00- -straight: | - # No comments. - [] > compares-bool-to-bytes - true - .eq - 01- - .and > @ - false - .eq - 00- -reversed: | +printed: | # No comments. [] > compares-bool-to-bytes and. > @ - eq. - true + true.eq 01- - eq. - false + false.eq 00- diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/dataless.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/dataless.yaml index 83b1784f12..242dc40796 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/dataless.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/dataless.yaml @@ -33,46 +33,17 @@ origin: | input-of args.at not-a-number -straight: | +printed: | +package sandbox # No comments. [args] > main - QQ - .io - .stdout > @ - args - .at - args - .length - .neg - nan - .plus > not-a-number - negative-infinity - text-of - input-of - args - .at - not-a-number - -reversed: | - +package sandbox - - # No comments. - [args] > main - stdout. > @ - io. - QQ - at. - args - neg. - length. - args - plus. > not-a-number - nan + io.stdout > @ + args.at + args.length.neg + nan.plus > not-a-number negative-infinity text-of input-of - at. - args + args.at not-a-number diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-bytes.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-bytes.yaml index 770e9c44dd..50aec6c613 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-bytes.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-bytes.yaml @@ -23,8 +23,5 @@ origin: | -- > empty -straight: | - -- > empty - -reversed: | +printed: | -- > empty diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-string.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-string.yaml index 90b30e89ec..0109d94b8f 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-string.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/empty-string.yaml @@ -26,24 +26,9 @@ origin: | QQ.io.stdout > @ QQ.txt.sprintf "" -straight: | +printed: | # No comments. [] > app - QQ - .io - .stdout > @ - QQ - .txt - .sprintf - "" - -reversed: | - # No comments. - [] > app - stdout. > @ - io. - QQ - sprintf. - txt. - QQ + io.stdout > @ + txt.sprintf "" diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/idiomatic.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/idiomatic.yaml index cac768a13b..e3236b237a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/idiomatic.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/idiomatic.yaml @@ -51,38 +51,7 @@ origin: | n "hello, 大家!" -straight: | - # This is the license part - # of the program - - +meta1 - +meta2 short - +meta2 long tail - - 3.1415 > pi - - # No comments. - [x x2 x3] > idiomatic - 5 > iTest_me - # No comments. - [] > rr /int - this - n - .minus - "\u5BB6" - 4.55 > x! - * - "Hello, \u0434\u0440\u0443\u0433" - 2.18 - true - .plus - bar - n - .plus - "hello, \u5927\u5BB6!" - .if > @ - -reversed: | +printed: | # This is the license part # of the program @@ -100,15 +69,14 @@ reversed: | if. > @ plus. this - minus. - n + n.minus "\u5BB6" - 4.55 > x! + x * "Hello, \u0434\u0440\u0443\u0433" 2.18 true bar - plus. - n + n.plus "hello, \u5927\u5BB6!" + 4.55 > x! diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml index c64a51c21e..4d346ce90a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml @@ -48,7 +48,7 @@ origin: | self v -straight: | +printed: | +package sandbox +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf @@ -60,54 +60,19 @@ straight: | 0 # No comments. [self v] > f - x - .write > @ + ^.x.write > @ v # No comments. [self v] > g - self - .f > @ - self - v - - # No comments. - [] > derived - base > @ - # No comments. - [self v] > f - self - .g > @ - self - v - -reversed: | - +package sandbox - +alias stdout org.eolang.io.stdout - +alias sprintf org.eolang.txt.sprintf - +architect yegor256@gmail.com - - # No comments. - [] > base - memory > x - 0 - # No comments. - [self v] > f - write. > @ - x - v - # No comments. - [self v] > g - f. > @ - self + self.f > @ self v # No comments. [] > derived - base > @ + Q.sandbox.base > @ # No comments. [self v] > f - g. > @ - self + self.g > @ self v diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/just-float.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/just-float.yaml index 395ba8e9af..52470ea435 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/just-float.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/just-float.yaml @@ -26,14 +26,7 @@ origin: | [] > foo 2.18 > e -straight: | - 3.14 > pi - - # No comments. - [] > foo - 2.18 > e - -reversed: | +printed: | 3.14 > pi # No comments. diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/multiline-string.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/multiline-string.yaml index 3dc980e402..553949bc85 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/multiline-string.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/multiline-string.yaml @@ -29,18 +29,8 @@ origin: | it's me """ -straight: | +printed: | # No comments. [] > app - QQ - .io - .stdout > @ - "Hello\nit's me" - -reversed: | - # No comments. - [] > app - stdout. > @ - io. - QQ + io.stdout > @ "Hello\nit's me" diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/stars-tuples.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/stars-tuples.yaml index 51b4c68cec..8354a9bacf 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/stars-tuples.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/stars-tuples.yaml @@ -23,13 +23,7 @@ origin: | * 1 "Hello" x > array -straight: | - * > array - 1 - "Hello" - x - -reversed: | +printed: | * > array 1 "Hello" diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/string-with-double-spaces.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/string-with-double-spaces.yaml index 7ffc35ddf6..c64d7f49aa 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/string-with-double-spaces.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/string-with-double-spaces.yaml @@ -27,8 +27,5 @@ origin: | x """ > other -straight: | - "z\n y\n x" > other - -reversed: | +printed: | "z\n y\n x" > other diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/times.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/times.yaml index 53d51a6743..e0c80b3619 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/times.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/times.yaml @@ -28,29 +28,11 @@ origin: | "result is %d\n" -1.times 228 -straight: | +printed: | # No comments. [] > app - QQ - .io - .stdout > @ - QQ - .txt - .sprintf - "result is %d\n" - -1 - .times - 228 - -reversed: | - # No comments. - [] > app - stdout. > @ - io. - QQ - sprintf. - txt. - QQ + io.stdout > @ + txt.sprintf "result is %d\n" times. -1 From db2fbb66fea32211109981efa9796e9e6c22bca5 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Mon, 27 Jan 2025 19:21:11 +0300 Subject: [PATCH 05/12] bug(#3845): sweet phi fix --- .../src/main/java/org/eolang/parser/Xmir.java | 50 ++++------------ .../org/eolang/parser/parse/build-fqns.xsl | 23 +++++++- .../org/eolang/parser/parse/roll-bases.xsl | 8 ++- .../org/eolang/parser/phi/to-phi.xsl | 59 +++++++------------ .../java/org/eolang/parser/EoSyntaxTest.java | 2 +- .../test/java/org/eolang/parser/XmirTest.java | 16 +++-- .../parser/eo-packs/parse/build-fqns.yaml | 15 +++-- .../parser/eo-packs/parse/roll-bases.yaml | 11 ++++ .../parser/eo-syntax/anonym-abstract.yaml | 32 ++++++++++ .../empty-line-before-application.yaml | 0 .../empty-line-before-first-object.yaml | 0 .../empty-line-before-method-2.yaml | 0 .../empty-line-before-method.yaml | 0 .../empty-line-before-ref-deep.yaml | 0 .../empty-line-before-ref.yaml | 0 .../empty-line-between-metas.yaml | 0 .../empty-line-in-vertical-application.yaml | 0 .../org/eolang/parser/phi-packs/specials.yaml | 3 + 18 files changed, 128 insertions(+), 91 deletions(-) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-application.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-first-object.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-method-2.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-method.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-ref-deep.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-before-ref.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-between-metas.yaml (100%) rename eo-parser/src/test/resources/org/eolang/parser/eo-typos/{ => empty-lines}/empty-line-in-vertical-application.yaml (100%) diff --git a/eo-parser/src/main/java/org/eolang/parser/Xmir.java b/eo-parser/src/main/java/org/eolang/parser/Xmir.java index 44f0b09beb..1e941d0350 100644 --- a/eo-parser/src/main/java/org/eolang/parser/Xmir.java +++ b/eo-parser/src/main/java/org/eolang/parser/Xmir.java @@ -24,13 +24,13 @@ package org.eolang.parser; import com.github.lombrozo.xnav.Xnav; +import com.jcabi.log.Logger; import com.jcabi.xml.XML; import com.yegor256.xsline.Shift; import com.yegor256.xsline.StClasspath; import com.yegor256.xsline.StEndless; 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.util.Collection; @@ -71,27 +71,12 @@ public final class Xmir implements XML { new StClasspath("/org/eolang/parser/print/tuples-to-stars.xsl") ), new StClasspath("/org/eolang/parser/print/dataized-to-const.xsl"), - new StUnhex(), - new StClasspath("/org/eolang/parser/print/wrap-data.xsl") + Xmir.UNHEX, + new StClasspath("/org/eolang/parser/print/wrap-data.xsl"), + new StClasspath("/org/eolang/parser/print/to-eo.xsl") ) ); - /** - * Train of transformations that prepare XMIR for conversion to PHI. - */ - private static final Train FOR_PHI = new TrFull( - new TrClasspath<>( - "/org/eolang/parser/parse/vars-float-up.xsl", - "/org/eolang/parser/parse/build-fqns.xsl", - "/org/eolang/parser/parse/expand-qqs.xsl", - "/org/eolang/parser/parse/expand-aliases.xsl", - "/org/eolang/parser/parse/resolve-aliases.xsl", - "/org/eolang/parser/parse/add-default-package.xsl", - "/org/eolang/parser/parse/explicit-data.xsl", - "/org/eolang/parser/phi/wrap-default-package.xsl" - ).back() - ); - /** * The XML. */ @@ -161,10 +146,7 @@ public Collection validate(final XML xsd) { * @return EO representation as {@link String} */ public String toEO() { - return this.converted( - Xmir.FOR_EO, "/org/eolang/parser/print/to-eo.xsl", - "eo" - ); + return this.converted(Xmir.FOR_EO, "eo"); } /** @@ -182,8 +164,7 @@ public String toPhi() { */ public String toPhi(final boolean conservative) { return this.converted( - new TrJoined<>( - Xmir.FOR_PHI, + new TrFull( new TrDefault<>( Xmir.UNHEX, new StClasspath( @@ -202,22 +183,13 @@ public String toPhi(final boolean conservative) { */ public String toSaltyPhi() { return this.converted( - Xmir.FOR_PHI, "/org/eolang/parser/phi/to-salty-phi.xsl", + new TrFull( + new TrClasspath<>("/org/eolang/parser/phi/to-salty-phi.xsl").back() + ), "phi" ); } - /** - * Converts XMIR. - * @param train Train of transformations that prepares XMIR - * @param xsl Final XSL transformation - * @param xpath Xpath to retrieve the final result - * @return XMIR in other representation as {@link String}. - */ - private String converted(final Train train, final String xsl, final String xpath) { - return this.converted(train.with(new StClasspath(xsl)), xpath); - } - /** * Converts XMIR. * @param train Train of transformations that prepares XMIR @@ -225,7 +197,9 @@ private String converted(final Train train, final String xsl, final Strin * @return XMIR in other representation as {@link String}. */ private String converted(final Train train, final String node) { - return new Xnav(new Xsline(train).pass(this.xml).inner()) + final XML xmir = new Xsline(train).pass(this.xml); + Logger.debug(this, "XMIR after converting to %s:\n%s", node, xmir); + return new Xnav(xmir.inner()) .element("program") .element(node) .text() diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl index 980e15da26..9f4f33cccc 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/build-fqns.xsl @@ -27,7 +27,7 @@ SOFTWARE. Here we go through all objects and find what their @base are referring to. If we find the object they refer to, we add either $ object (if target object in the same scope) - or necessary amount of ^. objects. Those objects + or necessary amount of '^.' objects. Those objects which are skipped after this transformation are not visible in the current scope. Maybe they are global or just a mistake. @@ -104,6 +104,13 @@ SOFTWARE.
+ + + The + + object is used, but absent in self or parents scope + + @@ -176,7 +183,8 @@ SOFTWARE. - + + @@ -211,6 +219,17 @@ SOFTWARE. + + + + + + + + + + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl index c7fc04b370..70ba5cf895 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl @@ -87,11 +87,17 @@ SOFTWARE. - + diff --git a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl index 1f093a13da..f47b3b8ada 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl @@ -101,10 +101,8 @@ SOFTWARE. - - @@ -112,7 +110,6 @@ SOFTWARE. - @@ -125,17 +122,24 @@ SOFTWARE. - + - + . + + + + . + + + + - @@ -276,6 +280,7 @@ SOFTWARE. + { @@ -342,7 +347,7 @@ SOFTWARE. - + @@ -354,34 +359,10 @@ SOFTWARE. - +
- - - - - - - . - - - - - - - - - - - - - - - - - @@ -389,7 +370,7 @@ SOFTWARE. - + @@ -400,11 +381,11 @@ SOFTWARE. - + - + @@ -429,7 +410,7 @@ SOFTWARE. - + @@ -454,7 +435,7 @@ SOFTWARE. - + @@ -506,7 +487,7 @@ SOFTWARE. - + @@ -559,7 +540,7 @@ SOFTWARE. - + diff --git a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java index 3a0f846c45..8bde893c77 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java @@ -309,7 +309,7 @@ void checksTypoPacks(final String yaml) { @ParameterizedTest @ClasspathSource(value = "org/eolang/parser/eo-packs/", glob = "**.yaml") - void checksEoTransformations(final String yaml) { + void checksEoPacks(final String yaml) { MatcherAssert.assertThat( "passed without exceptions", new XtSticky( diff --git a/eo-parser/src/test/java/org/eolang/parser/XmirTest.java b/eo-parser/src/test/java/org/eolang/parser/XmirTest.java index a0c1fbdb7d..129e27c3ff 100644 --- a/eo-parser/src/test/java/org/eolang/parser/XmirTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/XmirTest.java @@ -86,9 +86,13 @@ void printsToEo(final String pack) throws IOException { void convertsToSweetPhi(final String pack) throws IOException { final Xtory xtory = new XtSticky(new XtYaml(pack)); final boolean conservative = xtory.map().containsKey("conservative"); + final Xmir xmir = this.asXmir((String) xtory.map().get("input")); MatcherAssert.assertThat( - "Result PHI should be equal to provided PHI with syntax sugar", - this.asXmir((String) xtory.map().get("input")).toPhi(conservative), + String.format( + "Result PHI should be equal to provided PHI with syntax sugar, XMIR is:\n%s", + xmir + ), + xmir.toPhi(conservative), Matchers.equalTo(xtory.map().get("sweet")) ); } @@ -97,9 +101,13 @@ void convertsToSweetPhi(final String pack) throws IOException { @ClasspathSource(value = "org/eolang/parser/phi-packs", glob = "**.yaml") void convertsToSaltyPhi(final String pack) throws IOException { final Xtory xtory = new XtSticky(new XtYaml(pack)); + final Xmir xmir = this.asXmir((String) xtory.map().get("input")); MatcherAssert.assertThat( - "Result PHI should be equal to provided PHI with syntax sugar", - this.asXmir((String) xtory.map().get("input")).toSaltyPhi(), + String.format( + "Result PHI should be equal to provided PHI without syntax sugar, XMIR is:\n%s", + xmir + ), + xmir.toSaltyPhi(), Matchers.equalTo(xtory.map().get("salty")) ); } diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml index 2f872b215d..429e2095c6 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/build-fqns.yaml @@ -27,22 +27,23 @@ sheets: - /org/eolang/parser/parse/build-fqns.xsl asserts: - /program[not(errors)] - - /program/objects[count(o)=3] + - /program/objects[count(o)=4] - /program/objects/o[@base='.foo' and @name='bar']/o[@base='.examples']/o[@base='.org']/o[@base='Q'] - /program/objects/o[@name='foo'] - /program/objects/o[@name='first']/o[@base='stdout' and @name='std']/o[@base='.x']/o[@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@base='.std']/o[1][@base='$'] - - /program/objects/o[@name='first']/o[@name='second']/o[@base='.std']/o[2][@base='.x']/o[1][@base='^'] + - /program/objects/o[@name='first']/o[@name='second']/o[@base='.std']/o[2][@base='.x']/o[1][@base='.^']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='Q.org.eolang.number' and @name='x' and text()!=''] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.plus']/o[1][@base='.x']/o[1][@base='$'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.plus']/o[2][@base='.y']/o[1][@base='.^']/o[1][@base='^'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.std']/o[1][@base='^'] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.plus']/o[2][@base='.y']/o[1][@base='.^']/o[1][@base='.^']/o[1][@base='$'] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.std']/o[1][@base='.^']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.std']/o[2][@base='qwe'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.third']/o[1][@base='^'] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.third']/o[1][@base='.^']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='third']/o[@base='.third']/o[2][@base='.bar']/o[@base='.examples']/o[@base='.org']/o[@base='Q'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='Q.org.eolang.string' and @name='inner'] - - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='.inner' and @name='outer']/o[1][@base='^'] + - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='.inner' and @name='outer']/o[1][@base='.^']/o[1][@base='$'] - /program/objects/o[@name='first']/o[@name='second']/o[@name='fourth']/o[@base='.inner' and @name='self']/o[1][@base='$'] + - /program/objects/o[@name='s' and @base='.plus']/o[1][not(@base) and not(@name)]/o[1][@base='.^']/o[1][@base='$'] input: |- +package org.examples @@ -64,3 +65,5 @@ input: |- # Foo. [] > foo + + ([] (^ > x)).plus > s diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml index 30d685235d..3937f23ba4 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml @@ -36,12 +36,17 @@ sheets: - /org/eolang/parser/parse/explicit-data.xsl - /org/eolang/parser/parse/roll-bases.xsl asserts: + - /program/objects[count(o)=2] - //o[@base='$.two.a' and @name='one'] - //o[@base='$.three.b' and @name='two'] - //o[@base='Q.org.eolang.c' and @name='three'] - //o[@base='.with']/o[@base='Q.org.eolang.tuple.empty.with' and o[@base='Q.org.eolang.number']] - //o[@base='Q.org.eolang.true.if' and count(o)=2] - //o[@base='.if' and count(o)=3]/o[1][@base='$.x']/o[1][@base='Q.org.eolang.y'] + - //o[@base='.and']/o[1][@base='.eq']/o[1][@base='.as-bytes']/o[@base='Q.org.eolang.bytes' and text()!=''] + - //o[@base='.and']/o[1][@base='.eq']/o[2][@base='Q.org.eolang.true'] + - //o[@base='.and']/o[2][@base='.eq']/o[1][@base='.as-bytes']/o[@base='Q.org.eolang.bytes' and text()!=''] + - //o[@base='.and']/o[2][@base='.eq']/o[2][@base='Q.org.eolang.false'] input: | # No comment. [x] > foo @@ -55,3 +60,9 @@ input: | y 2 1 + + # This unit test is supposed to check the functionality of the corresponding object. + [] > compares-bool-to-bytes-reverse + and. > @ + 01-.as-bytes.eq true + 00-.as-bytes.eq false diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml new file mode 100644 index 0000000000..ca18d33229 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml @@ -0,0 +1,32 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +sheets: [ ] +asserts: + - //objects[count(o)=3] + - //o[@base='$.x.plus' and @name='a'] + - //o[@base='Q.org.eolang.number' and @name='@' and o[@base="Q.org.eolang.bytes" and starts-with(text(), '40-14')]] +input: | + # No comments. + [] > test + ([] (^ > x)).plus > s + int diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-application.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-application.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-first-object.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-first-object.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-first-object.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-first-object.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-method-2.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-method-2.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-method-2.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-method-2.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-method.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-method.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-method.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-method.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-ref-deep.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-ref-deep.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-ref-deep.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-ref-deep.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-ref.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-ref.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-before-ref.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-before-ref.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-between-metas.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-between-metas.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-between-metas.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-between-metas.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-in-vertical-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-in-vertical-application.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-line-in-vertical-application.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-typos/empty-lines/empty-line-in-vertical-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml b/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml index a4be8239cc..12e96aa50b 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml @@ -23,12 +23,14 @@ input: | # No comments. [] > main + 5 > @ ^.x > x $.a > b @.@ > phi sweet: |- {⟦ main ↦ ⟦ + φ ↦ 5, x ↦ ξ.ρ.x, b ↦ ξ.a, phi ↦ ξ.φ.φ @@ -38,6 +40,7 @@ salty: |- { ⟦ main ↦ ⟦ + φ ↦ 5, x ↦ ξ.ρ.x, b ↦ ξ.a, phi ↦ ξ.φ.φ From fc61bcb7fd5f8e7bce2ce915f4f1c99209eb6556 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Tue, 28 Jan 2025 13:58:41 +0300 Subject: [PATCH 06/12] bug(#3845): salty phi fix --- .../org/eolang/parser/phi/to-phi.xsl | 8 ----- .../org/eolang/parser/phi/to-salty-phi.xsl | 35 +++++++++---------- .../org/eolang/parser/phi-packs/specials.yaml | 6 +++- 3 files changed, 21 insertions(+), 28 deletions(-) diff --git a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl index f47b3b8ada..d0926ae349 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl @@ -85,14 +85,6 @@ SOFTWARE. - - - - - - . - - diff --git a/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl b/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl index c83f4a634e..3aa6b233cc 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl @@ -71,14 +71,6 @@ SOFTWARE. - - - - - - . - - @@ -87,10 +79,8 @@ SOFTWARE. - - @@ -98,7 +88,6 @@ SOFTWARE. - @@ -121,8 +110,15 @@ SOFTWARE. . + + + + . + + + + - @@ -149,6 +145,7 @@ SOFTWARE. + { @@ -212,7 +209,7 @@ SOFTWARE. - + @@ -221,7 +218,7 @@ SOFTWARE. - + . @@ -245,7 +242,7 @@ SOFTWARE. - + @@ -256,7 +253,7 @@ SOFTWARE. - + @@ -279,7 +276,7 @@ SOFTWARE. - + ( @@ -317,7 +314,7 @@ SOFTWARE. - + @@ -366,7 +363,7 @@ SOFTWARE. - + diff --git a/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml b/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml index 12e96aa50b..826113996a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/phi-packs/specials.yaml @@ -40,7 +40,11 @@ salty: |- { ⟦ main ↦ ⟦ - φ ↦ 5, + φ ↦ Φ.org.eolang.number( + α0 ↦ Φ.org.eolang.bytes( + α0 ↦ ⟦ Δ ⤍ 40-14-00-00-00-00-00-00 ⟧ + ) + ), x ↦ ξ.ρ.x, b ↦ ξ.a, phi ↦ ξ.φ.φ From aade428ddfd502fdde6b7f617fbfedcc45b76310 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Tue, 28 Jan 2025 14:42:44 +0300 Subject: [PATCH 07/12] bug(#3845): salty to sweet and back --- .../java/org/eolang/parser/PhiSyntax.java | 3 +- .../org/eolang/parser/parse/roll-bases.xsl | 31 +++++++++++++++---- .../java/org/eolang/parser/EoSyntaxTest.java | 1 + .../parser/eo-packs/parse/roll-bases.yaml | 13 +++++++- .../parser/eo-syntax/anonym-abstract.yaml | 5 ++- .../eolang/parser/eo-syntax/recursion.yaml | 2 +- .../parser/eo-syntax/space-between.yaml | 2 +- 7 files changed, 44 insertions(+), 13 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java b/eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java index 76b2e14a37..d7c5298b51 100644 --- a/eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/PhiSyntax.java @@ -55,7 +55,8 @@ public final class PhiSyntax implements Syntax { "/org/eolang/parser/parse/wrap-method-calls.xsl", "/org/eolang/parser/unphi/wrap-bytes.xsl", "/org/eolang/parser/unphi/normalize-bytes.xsl", - "/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl" + "/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl", + "/org/eolang/parser/parse/roll-bases.xsl" ).back() ) ); diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl index 70ba5cf895..1918bedef3 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl @@ -73,6 +73,25 @@ SOFTWARE. + + + + + + + + + + + + + + + diff --git a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java index 8bde893c77..f395872114 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java @@ -27,6 +27,7 @@ import com.jcabi.matchers.XhtmlMatchers; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; +import com.yegor256.xsline.StClasspath; import com.yegor256.xsline.TrDefault; import java.io.IOException; import java.nio.charset.StandardCharsets; diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml index 3937f23ba4..0e38a14b53 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/roll-bases.yaml @@ -36,7 +36,7 @@ sheets: - /org/eolang/parser/parse/explicit-data.xsl - /org/eolang/parser/parse/roll-bases.xsl asserts: - - /program/objects[count(o)=2] + - /program/objects[count(o)=3] - //o[@base='$.two.a' and @name='one'] - //o[@base='$.three.b' and @name='two'] - //o[@base='Q.org.eolang.c' and @name='three'] @@ -47,6 +47,7 @@ asserts: - //o[@base='.and']/o[1][@base='.eq']/o[2][@base='Q.org.eolang.true'] - //o[@base='.and']/o[2][@base='.eq']/o[1][@base='.as-bytes']/o[@base='Q.org.eolang.bytes' and text()!=''] - //o[@base='.and']/o[2][@base='.eq']/o[2][@base='Q.org.eolang.false'] + - //o[@name='bts']/o[1][@base='.eq']/o[1][@base='.as-bytes']/o[1][@base='Q.org.eolang.bytes' and text()!=''] input: | # No comment. [x] > foo @@ -66,3 +67,13 @@ input: | and. > @ 01-.as-bytes.eq true 00-.as-bytes.eq false + + # No comments. + [] > bts + eq. > @ + as-bytes. + bytes. + eolang. + org. + Q + 01- diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml index ca18d33229..70656f8ebb 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/anonym-abstract.yaml @@ -22,9 +22,8 @@ --- sheets: [ ] asserts: - - //objects[count(o)=3] - - //o[@base='$.x.plus' and @name='a'] - - //o[@base='Q.org.eolang.number' and @name='@' and o[@base="Q.org.eolang.bytes" and starts-with(text(), '40-14')]] + - //objects[count(o)=1] + - //o[@base='.plus' and @name='s' and o[1][not(@name) and not(@base)]/o[@base='$.^']]/o[2][@base='Q.org.eolang.int'] input: | # No comments. [] > test diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml index 35e322f2cb..c24c35a420 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/recursion.yaml @@ -24,7 +24,7 @@ sheets: [ ] asserts: - /program[not(errors)] - //o[@name='f' and @line='8'] - - //o[@base='^.f'] + - //o[@base='$.^.f'] input: | +home https://github.com/objectionary/eo +package test diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml index f0bf36b269..be8df42db7 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/space-between.yaml @@ -23,7 +23,7 @@ sheets: [ ] asserts: - /program[not(errors)] - - //o[@base='^.a.plus' and @name='@']/o[@base='^.b'] + - //o[@base='$.^.a.plus' and @name='@']/o[@base='$.^.b'] input: | +home https://github.com/objectionary/eo +package org.eolang.priority From 69c4cd55c9f4aabef004992adf8d1bf4b03b99d0 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Tue, 28 Jan 2025 17:41:17 +0300 Subject: [PATCH 08/12] bug(#3845): parser --- .../main/java/org/eolang/maven/PrintMojo.java | 22 ++------------ .../java/org/eolang/maven/ShakeMojoTest.java | 8 ++--- .../maven/shake-packs/add-locators.yaml | 15 +++------- .../maven/shake-packs/add-locs-with-dot.yml | 2 +- .../org/eolang/maven/shake-packs/add-locs.yml | 2 +- .../shake-packs/add-probes-to-empty.yaml | 15 +++------- .../eolang/maven/shake-packs/add-probes.yaml | 15 +++------- .../maven/shake-packs/adds-no-probes.yaml | 15 +++------- .../maven/shake-packs/cti-adds-error.yaml | 2 +- .../maven/shake-packs/cti-adds-warning.yaml | 2 +- .../maven/shake-packs/sets-blank-schema.yaml | 2 +- .../java/org/eolang/parser/DrProgram.java | 8 ++++- .../main/java/org/eolang/parser/EoSyntax.java | 3 +- eo-parser/src/main/resources/XMIR.xsd | 30 +++++++++++++++++-- .../eolang/parser/parse/expand-aliases.xsl | 25 +++++++++++++--- .../org/eolang/parser/parse/roll-bases.xsl | 16 +++++----- .../org/eolang/parser/phi/to-phi.xsl | 9 +++++- .../org/eolang/parser/phi/to-salty-phi.xsl | 9 +++++- .../org/eolang/parser/unphi/wrap-bytes.xsl | 2 +- .../java/org/eolang/parser/EoSyntaxTest.java | 7 ++--- .../eo-packs/parse/add-default-package.yaml | 2 +- .../parser/eo-packs/parse/expand-aliases.yaml | 4 +-- .../eo-packs/parse/resolve-aliases.yaml | 4 +-- .../parser/print-packs/yaml/inheritance.yaml | 4 +-- 24 files changed, 118 insertions(+), 105 deletions(-) diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/PrintMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/PrintMojo.java index 029cacd312..f1097d907a 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/PrintMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/PrintMojo.java @@ -24,7 +24,6 @@ package org.eolang.maven; import com.jcabi.log.Logger; -import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; import java.io.File; import java.io.IOException; @@ -72,17 +71,6 @@ public final class PrintMojo extends SafeMojo { ) private File printOutputDir; - /** - * Print EO in reversed notation. - * @checkstyle MemberNameCheck (10 lines) - */ - @Parameter( - property = "eo.printReversed", - required = true, - defaultValue = "false" - ) - private boolean printReversed; - @Override void exec() throws IOException { final Home home = new HmBase(this.printOutputDir); @@ -93,13 +81,9 @@ void exec() throws IOException { this.printSourcesDir.toPath().relativize(source).toString() .replace(".xmir", ".eo") ); - final XML xml = new XMLDocument(new TextOf(source).asString()); - final String program; - if (this.printReversed) { - program = new Xmir(xml).toReversedEO(); - } else { - program = new Xmir(xml).toEO(); - } + final String program = new Xmir( + new XMLDocument(new TextOf(source).asString()) + ).toEO(); home.save(program, relative); Logger.info( this, diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java index 790c7fad16..3af574bb76 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java @@ -56,6 +56,7 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; +import org.junit.jupiter.params.ParameterizedTest; /** * Test case for {@link ShakeMojo}. @@ -89,7 +90,7 @@ void shakesSimpleObject(@Mktmp final Path temp) throws Exception { ); } - @Test + @ParameterizedTest @ClasspathSource(value = "org/eolang/maven/shake-packs/", glob = "**.yaml") void checksShakePacks(final String yaml) { MatcherAssert.assertThat( @@ -98,10 +99,7 @@ void checksShakePacks(final String yaml) { new XtStrict( new XtYaml( yaml, - eo -> new EoSyntax( - "scenario", - String.format("%s\n", eo) - ).parsed() + eo -> new EoSyntax("scenario", String.format("%s\n", eo)).parsed() ) ) ), diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml index fa665f974a..43d594a818 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml @@ -21,17 +21,10 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-probes.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl - - /org/eolang/parser/shake/set-locators.xsl - - /org/eolang/parser/shake/blank-xsd-schema.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/set-locators.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - //o[@name='a' and @loc='Φ.org.abc.a'] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml index 82ebaf817f..b6de131087 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/set-locators.xsl + - /org/eolang/maven/shake/set-locators.xsl document: diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml index 824afdb08a..70f9151fb4 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/set-locators.xsl + - /org/eolang/maven/shake/set-locators.xsl document: diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml index 4db42ea227..9731ef4df7 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml @@ -21,17 +21,10 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-probes.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl - - /org/eolang/parser/shake/set-locators.xsl - - /org/eolang/parser/shake/blank-xsd-schema.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/set-locators.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - //metas[count(.//meta[head/text()='probe'])=1] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml index 6863dfb6e4..db7905dece 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml @@ -21,17 +21,10 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-probes.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl - - /org/eolang/parser/shake/set-locators.xsl - - /org/eolang/parser/shake/blank-xsd-schema.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/set-locators.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - /program/sheets/sheet[contains(text(),'add-probes')] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml index 0554844449..007b9a8987 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml @@ -21,17 +21,10 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl - - /org/eolang/parser/shake/vars-float-up.xsl - - /org/eolang/parser/shake/build-fqns.xsl - - /org/eolang/parser/shake/expand-qqs.xsl - - /org/eolang/parser/shake/add-probes.xsl - - /org/eolang/parser/shake/expand-aliases.xsl - - /org/eolang/parser/shake/resolve-aliases.xsl - - /org/eolang/parser/shake/add-default-package.xsl - - /org/eolang/parser/shake/explicit-data.xsl - - /org/eolang/parser/shake/set-locators.xsl - - /org/eolang/parser/shake/blank-xsd-schema.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/set-locators.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - /program[not(metas)] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml index b79859e4ed..2d5d4e97e2 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-error.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl asserts: - /program/errors[count(*)=1] - /program/errors/error[@check='cti'] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml index 1cb9301385..dc670f2594 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/cti-adds-errors.xsl asserts: - /program/errors[count(*)=1] - /program/errors/error[@check='cti'] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml index e59823cd73..44eb6657d7 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/sets-blank-schema.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- sheets: - - /org/eolang/parser/shake/blank-xsd-schema.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[@xsi:noNamespaceSchemaLocation='https://www.eolang.org/xsd/XMIR-anything.xsd'] input: | diff --git a/eo-parser/src/main/java/org/eolang/parser/DrProgram.java b/eo-parser/src/main/java/org/eolang/parser/DrProgram.java index 4a6e10ac7a..c277e59243 100644 --- a/eo-parser/src/main/java/org/eolang/parser/DrProgram.java +++ b/eo-parser/src/main/java/org/eolang/parser/DrProgram.java @@ -58,6 +58,12 @@ public Iterator iterator() { final String when = ZonedDateTime.now(ZoneOffset.UTC).format( DateTimeFormatter.ISO_INSTANT ); + final String nme; + if (this.name.startsWith("Q.")) { + nme = this.name.substring(2); + } else { + nme = this.name; + } return new Directives() .comment( String.join( @@ -90,7 +96,7 @@ public Iterator iterator() { "noNamespaceSchemaLocation xsi http://www.w3.org/2001/XMLSchema-instance", DrProgram.schema() ) - .attr("name", this.name) + .attr("name", nme) .attr("version", Manifests.read("EO-Version")) .attr("revision", Manifests.read("EO-Revision")) .attr("dob", Manifests.read("EO-Dob")) diff --git a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java index 704b0d38f5..437494f58e 100644 --- a/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java +++ b/eo-parser/src/main/java/org/eolang/parser/EoSyntax.java @@ -130,6 +130,7 @@ public EoSyntax(final String nme, final String ipt) { * * @param nme The name of the EO program being parsed * @param ipt The EO program to parse + * @param transform Transform XMIR after parsing */ public EoSyntax(final String nme, final String ipt, final Train transform) { this(nme, new InputOf(ipt), transform); @@ -161,7 +162,7 @@ public EoSyntax(final String nme, final Input ipt) { * @param ipt The EO program to parse * @param transform Transform XMIR after parsing function */ - EoSyntax(final String nme, final Input ipt, Function transform) { + EoSyntax(final String nme, final Input ipt, final Function transform) { this.name = nme; this.input = ipt; this.transform = transform; diff --git a/eo-parser/src/main/resources/XMIR.xsd b/eo-parser/src/main/resources/XMIR.xsd index e8e0823ec7..fa908b7e12 100644 --- a/eo-parser/src/main/resources/XMIR.xsd +++ b/eo-parser/src/main/resources/XMIR.xsd @@ -96,7 +96,31 @@ SOFTWARE. - + + + + + + The name of the program + + The name of the program + + + + + + + + + A fully qualified name of an object starting from global scope + + The global fully qualified name of an object, which includes the names of all the objects that are its ancestors. + This type is used to uniquely identify an object within the program. The FQN is typically used to reference + from the global scope, ensuring that the correct object is accessed or modified. + + + + @@ -162,7 +186,7 @@ SOFTWARE. - + @@ -386,7 +410,7 @@ SOFTWARE. - + The name of the program, usually equal to the name of the object defined in it diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl index f7374f7a27..91437e9823 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/expand-aliases.xsl @@ -34,20 +34,37 @@ SOFTWARE. +alias foo org.example.foo --> - + + + + + + + + + + + + + + + + Q. + + + - - + - + diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl index 1918bedef3..d71dd9e1ee 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/roll-bases.xsl @@ -106,17 +106,21 @@ SOFTWARE. - + @@ -155,9 +159,6 @@ SOFTWARE. - - - - - diff --git a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl index d0926ae349..42990d4acd 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/phi/to-phi.xsl @@ -121,7 +121,14 @@ SOFTWARE. . - + + + + + + + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl b/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl index 3aa6b233cc..4c022dfd20 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/phi/to-salty-phi.xsl @@ -108,7 +108,14 @@ SOFTWARE. . - + + + + + + + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/unphi/wrap-bytes.xsl b/eo-parser/src/main/resources/org/eolang/parser/unphi/wrap-bytes.xsl index 107c5683e8..0cada53d5d 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/unphi/wrap-bytes.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/unphi/wrap-bytes.xsl @@ -33,7 +33,7 @@ SOFTWARE. - org.eolang.bytes + Q.org.eolang.bytes diff --git a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java index f395872114..b0c539ac11 100644 --- a/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/EoSyntaxTest.java @@ -27,7 +27,6 @@ import com.jcabi.matchers.XhtmlMatchers; import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; -import com.yegor256.xsline.StClasspath; import com.yegor256.xsline.TrDefault; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -178,7 +177,7 @@ void parsesArrow() throws IOException { new InputOf("1 > x") ).parsed(), XhtmlMatchers.hasXPaths( - "/program/objects/o[@base='number' and @name='x' and text()]" + "/program/objects/o[@base='Q.org.eolang.number' and @name='x' and o[text()]]" ) ); } @@ -241,8 +240,8 @@ void parsesMethodCalls() throws IOException { XhtmlMatchers.hasXPaths( "/program[@name='test-xml-1']", "/program/objects/o[@base='.add']", - "/program/objects/o/o[@base='number']", - "/program/objects/o/o[@base='true']" + "/program/objects/o/o[@base='Q.org.eolang.number']", + "/program/objects/o/o[@base='Q.org.eolang.true']" ) ); } diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml index 5bd76b2f29..e870e83307 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/add-default-package.yaml @@ -31,7 +31,7 @@ asserts: - /program[not(errors)] - /program/objects[count(o)=1] - //o[@base='Q.org.eolang.and' and @line='9'] - - //o[@base='foo'] + - //o[@base='Q.foo'] - //o[@base='$'] - //o[@base='^'] - //o[@base='Q'] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml index 9b7919a4c5..c79b41f9c9 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/expand-aliases.yaml @@ -25,8 +25,8 @@ sheets: - /org/eolang/parser/parse/expand-aliases.xsl asserts: - /program[not(errors)] - - //meta[head='alias' and tail='scanner org.eolang.txt.scanner' and part[1]='scanner' and part[2]='org.eolang.txt.scanner'] - - //meta[head='alias' and tail='stdin org.eolang.io.stdin' and part[1]='stdin' and part[2]='org.eolang.io.stdin'] + - //meta[head='alias' and tail='scanner Q.org.eolang.txt.scanner' and part[1]='scanner' and part[2]='Q.org.eolang.txt.scanner'] + - //meta[head='alias' and tail='stdin Q.org.eolang.io.stdin' and part[1]='stdin' and part[2]='Q.org.eolang.io.stdin'] input: | +alias org.eolang.txt.scanner +alias stdin org.eolang.io.stdin diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml index a6237495f0..1e5849a283 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-packs/parse/resolve-aliases.yaml @@ -31,8 +31,8 @@ asserts: - /program/objects[count(o)=1] - /program/metas/meta[head='foo' and @line='4'] - /program/metas[count(meta)=4] - - //o[@base='org.eolang.txt.scanner'] - - //o[@base='org.eolang.io.stdout' and @line='10'] + - //o[@base='Q.org.eolang.txt.scanner'] + - //o[@base='Q.org.eolang.io.stdout' and @line='10'] - //o[@base='and' and @line='8'] - //o[@base='$'] - //o[@base='^'] diff --git a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml index 4d346ce90a..2190d1deff 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/print-packs/yaml/inheritance.yaml @@ -50,8 +50,8 @@ origin: | printed: | +package sandbox - +alias stdout org.eolang.io.stdout - +alias sprintf org.eolang.txt.sprintf + +alias stdout Q.org.eolang.io.stdout + +alias sprintf Q.org.eolang.txt.sprintf +architect yegor256@gmail.com # No comments. From 507474a3585c2c0ba7b1b6d9e152f56f56498296 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Tue, 28 Jan 2025 17:48:28 +0300 Subject: [PATCH 09/12] bug(#3845): cti --- .../eolang/maven/shake/cti-adds-errors.xsl | 8 ++++---- .../maven/shake-packs/add-locators.yaml | 20 ++++++++----------- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl index f4f775fd68..0068dd7908 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl @@ -30,20 +30,20 @@ SOFTWARE. - + - + - + - + cti diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml index 43d594a818..5c99869da6 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml @@ -28,20 +28,16 @@ sheets: asserts: - /program[not(errors)] - //o[@name='a' and @loc='Φ.org.abc.a'] - - //o[@base='x' and @loc='Φ.org.abc.a.φ.α0'] - - //o[@base='org.eolang.string' and @loc='Φ.org.abc.a.φ.α0.α0'] - - //o[@base='x' and @name='tt' and @loc='Φ.org.abc.tt'] - - //o[@base='org.eolang.number' and @loc='Φ.org.abc.tt.α0'] - - //o[@base='org.eolang.tuple' and @loc='Φ.org.abc.tt.α1.ρ.ρ.ρ'] - - //o[@base='org.eolang.number' and @loc='Φ.org.abc.tt.α1.ρ.α0'] + - //o[@base='Q.x' and @loc='Φ.org.abc.a.φ.α0'] + - //o[@base='Q.org.eolang.string' and @loc='Φ.org.abc.a.φ.α0.α0'] + - //o[@base='Q.x' and @name='tt' and @loc='Φ.org.abc.tt'] + - //o[@base='Q.org.eolang.number' and @loc='Φ.org.abc.tt.α0'] + - //o[@base='Q.org.eolang.tuple.empty.with' and @loc='Φ.org.abc.tt.α1.ρ'] + - //o[@base='Q.org.eolang.number' and @loc='Φ.org.abc.tt.α1.ρ.α0'] - //o[not(@base) and @loc='Φ.org.abc.tt.α2'] - //o[@base='∅' and @name='e' and @loc='Φ.org.abc.tt.α2.e'] - - //o[@base='.hello' and @loc='Φ.org.abc.tt.α2.φ'] - - //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='$.e.hello' and @loc='Φ.org.abc.tt.α2.φ'] + - //o[@base='$.^.^.p' and @loc='Φ.org.abc.q'] input: | +alias org.abc.foo.b +alias x From 922e0c6ded6df060d1f65321892d83dd044214fb Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 29 Jan 2025 17:05:37 +0300 Subject: [PATCH 10/12] bug(#3845): no discover --- .../java/org/eolang/maven/AssembleMojo.java | 2 +- .../main/java/org/eolang/maven/ProbeMojo.java | 6 +- .../org/eolang/maven/shake/add-probes.xsl | 137 ++++++++++++------ .../org/eolang/maven/transpile/data.xsl | 1 - .../org/eolang/maven/transpile/to-java.xsl | 111 ++++++++------ .../org/eolang/maven/DiscoverMojoTest.java | 2 + .../test/java/org/eolang/maven/FakeMaven.java | 6 +- .../java/org/eolang/maven/LintMojoTest.java | 3 +- .../java/org/eolang/maven/PhiMojoTest.java | 4 +- .../java/org/eolang/maven/PrintMojoTest.java | 16 +- .../java/org/eolang/maven/ProbeMojoTest.java | 7 +- .../java/org/eolang/maven/PullMojoTest.java | 28 ---- .../eolang/maven/RandomProgramResolver.java | 1 + .../java/org/eolang/maven/ShakeMojoTest.java | 5 +- .../org/eolang/maven/TranspileMojoTest.java | 1 + .../test/resources/org/eolang/maven/mess.eo | 2 + .../shake-packs/add-probes-to-empty.yaml | 3 +- .../eolang/maven/shake-packs/add-probes.yaml | 24 +-- .../maven/shake-packs/adds-no-probes.yaml | 2 - .../maven/transpile-packs/embedded-class.yaml | 9 +- .../maven/transpile-packs/fetching.yaml | 46 ++++++ .../maven/transpile-packs/tuple-to-java.yaml | 4 +- .../eolang/maven/unphi-packs/bindings.yaml | 11 +- .../maven/unphi-packs/delta-in-formation.yaml | 2 +- .../eolang/maven/unphi-packs/empty-bytes.yaml | 2 +- .../maven/unphi-packs/inline-application.yaml | 14 +- .../maven/unphi-packs/normalized-atom.yaml | 6 +- .../eolang/maven/unphi-packs/one-byte.yaml | 2 +- .../org/eolang/maven/unphi-packs/package.yaml | 2 +- .../eolang/maven/unphi-packs/pretty-data.yaml | 4 +- .../eolang/maven/unphi-packs/specials.yaml | 6 +- .../unphi-packs/termination-with-tail.yaml | 4 +- .../eolang/maven/unphi-packs/termination.yaml | 2 +- .../unphi-packs/with-anonym-abstract.yaml | 4 +- .../eolang/maven/unphi-packs/with-data.yaml | 3 +- .../parser/unphi/atoms-with-bound-attrs.xsl | 5 +- eo-runtime/src/main/eo/org/eolang/tuple.eo | 1 + 37 files changed, 281 insertions(+), 207 deletions(-) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/fetching.yaml diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java index b6f38a8cef..ff5e843664 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java @@ -235,7 +235,7 @@ public void exec() { final Moja[] mojas = { new Moja<>(ParseMojo.class), new Moja<>(ShakeMojo.class), - new Moja<>(DiscoverMojo.class), +// new Moja<>(DiscoverMojo.class), new Moja<>(ProbeMojo.class), new Moja<>(PullMojo.class), new Moja<>(ResolveMojo.class), diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java index 54caa8e4ce..d77cfdaa7d 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java @@ -110,6 +110,7 @@ private void probe() throws IOException { for (final ForeignTojo tojo : tojos) { final Path src = tojo.shaken(); final Collection objects = this.probes(src); + System.out.println(objects); if (!objects.isEmpty()) { Logger.debug(this, "Probing object(s): %s", objects); } @@ -137,10 +138,7 @@ private void probe() throws IOException { ); } } else if (probed.isEmpty()) { - Logger.debug( - this, "No probes found in %d programs", - tojos.size() - ); + Logger.info(this, "No probes found in %d programs", tojos.size()); } else { Logger.info( this, "Found %d probe(s) in %d program(s) in %[ms]s: %s", diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl index 0e509226c6..1a5ca1fb33 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl @@ -24,80 +24,121 @@ SOFTWARE. --> + - - - - - - - - - - - + + + + + probe + + + + + + + + + - - - - + + + - + + + + + + + + + + + - - - - + + + - - - - - - - - - - - - probe - - - - - - - - - + + + + + +

+ +

+
+ +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/data.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/data.xsl index 763037607a..cd1356bddf 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/data.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/data.xsl @@ -28,7 +28,6 @@ SOFTWARE. - new byte[] { diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl index c81d9adcfa..ca9f408022 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl @@ -53,18 +53,6 @@ SOFTWARE.
- - - - - - Phi.Φ - - .take(" - - ") - - @@ -142,6 +130,46 @@ SOFTWARE. r + + + + + + + Phi.Φ + + + + + + + FQN must start with either with Q or $, but + + found + + + + + + + + + + + + .take(" + + "); + + + new PhMethod( + + , " + + "); + + + @@ -482,27 +510,37 @@ SOFTWARE. = - - - .copy() - - - - - - Phi.Φ - - - - .take(" - - ") + + - + + + + + + + .take(" + + ") + + + .copy() + + ; + + + + + + + = + + + + - ; @@ -537,20 +575,7 @@ SOFTWARE. Phi = - - - - b.take(" - - - - new PhMethod( - - b, " - - - - "); + diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java index b999c6e62b..069454e367 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java @@ -37,6 +37,7 @@ import org.eolang.maven.tojos.ForeignTojo; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; @@ -48,6 +49,7 @@ * @since 0.28.11 */ @ExtendWith(MktmpResolver.class) +@Disabled final class DiscoverMojoTest { @ParameterizedTest @CsvSource({ diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java index 7453c4ba45..39ed0d2cae 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java @@ -328,6 +328,8 @@ FakeMaven withPlacedBinary(final Path binary) { FakeMaven withHelloWorld() throws IOException { return this.withProgram( "+alias stdout org.eolang.io.stdout", + "+unlint object-has-data", + "+unlint broken-alias-second", "+package f\n", "# No comments.", "[x] > main", @@ -710,7 +712,7 @@ public Iterator> iterator() { return Arrays.>asList( ParseMojo.class, ShakeMojo.class, - DiscoverMojo.class, +// DiscoverMojo.class, ProbeMojo.class ).iterator(); } @@ -728,7 +730,7 @@ public Iterator> iterator() { return Arrays.>asList( ParseMojo.class, ShakeMojo.class, - DiscoverMojo.class, +// DiscoverMojo.class, ProbeMojo.class, PullMojo.class ).iterator(); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java index 0272a34adf..c90cc7c3c8 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/LintMojoTest.java @@ -181,7 +181,8 @@ void doesNotDetectWarningWithoutCorrespondingFlag(@Mktmp final Path temp) { Assertions.assertDoesNotThrow( () -> new FakeMaven(temp) .withProgram( - "+package f\n", + "+package f", + "+unlint object-has-data\n", "# No comments.", "[] > main", " # No comments.", diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java index 09799ac3db..a505d30e05 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/PhiMojoTest.java @@ -143,8 +143,8 @@ void convertsObjectWithSystemType(@Mktmp final Path temp) throws Exception { ), XhtmlMatchers.hasXPaths( "/program/objects/o[@name='bytes']", - "/program/objects/o/o[@base='.eq']", - "/program/objects/o/o/o[@base='bytes' and text()='01-02-03']" + "/program/objects/o/o[@base='$.eq']", + "/program/objects/o/o/o[@base='Q.org.eolang.bytes' and text()='01-02-03']" ) ); MatcherAssert.assertThat( diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/PrintMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/PrintMojoTest.java index 1c54076990..2466a6d7ab 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/PrintMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/PrintMojoTest.java @@ -117,25 +117,13 @@ void printsSuccessfully(@Mktmp final Path temp) throws Exception { @ParameterizedTest @ClasspathSource(value = "org/eolang/maven/print-packs", glob = "**.yaml") - void printsInStraightNotation(final String pack, @Mktmp final Path temp) throws Exception { + void printsXmirToEo(final String pack, @Mktmp final Path temp) throws Exception { final Xtory xtory = new XtSticky(new XtYaml(pack)); Assumptions.assumeTrue(xtory.map().get("skip") == null); MatcherAssert.assertThat( "PrintMojo should print EO in straight notation, but it didn't", PrintMojoTest.printed(xtory, temp, false).asString(), - Matchers.equalTo((String) xtory.map().get("straight")) - ); - } - - @ParameterizedTest - @ClasspathSource(value = "org/eolang/maven/print-packs", glob = "**.yaml") - void printsInReversedNotation(final String pack, @Mktmp final Path temp) throws Exception { - final Xtory xtory = new XtSticky(new XtYaml(pack)); - Assumptions.assumeTrue(xtory.map().get("skip") == null); - MatcherAssert.assertThat( - "PrintMojo should print EO in reversed notation, but it didn't", - PrintMojoTest.printed(xtory, temp, true).asString(), - Matchers.equalTo((String) xtory.map().get("reversed")) + Matchers.equalTo((String) xtory.map().get("printed")) ); } diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java index f67dda2c82..836ae3603d 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java @@ -30,6 +30,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.cactoos.io.ResourceOf; +import org.eolang.maven.footprint.Saved; import org.eolang.maven.hash.ChCached; import org.eolang.maven.hash.ChRemote; import org.eolang.maven.hash.ChText; @@ -49,7 +50,7 @@ final class ProbeMojoTest { @Test void findsProbes(@Mktmp final Path temp) throws Exception { - final String expected = "5"; + final String expected = "10"; MatcherAssert.assertThat( String.format( "Number of objects that we should find during the probing phase should be equal %s", @@ -73,7 +74,7 @@ void findsProbesViaOfflineHashFile(@Mktmp final Path temp) throws IOException { new ResourceOf(tags), Paths.get("tags.txt") ); - final String expected = "5"; + final String expected = "10"; MatcherAssert.assertThat( String.format( "Number of objects that we should find during the probing phase should be equal %s", @@ -104,7 +105,7 @@ void findsProbesInOyRemote(@Mktmp final Path temp) throws IOException { .execute(new FakeMaven.Probe()) .programTojo() .probed(), - Matchers.equalTo("2") + Matchers.equalTo("5") ); } diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java index 0c00b1d444..8a87f54711 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/PullMojoTest.java @@ -44,13 +44,10 @@ import org.eolang.maven.hash.ChRemote; import org.eolang.maven.hash.ChText; import org.eolang.maven.hash.CommitHash; -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.hamcrest.io.FileMatchers; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -183,31 +180,6 @@ void doesNotPullInOfflineMode(@Mktmp final Path tmp) throws IOException { ); } - @Test - @CaptureLogs - void showsWhereNotFoundWasDiscoveredAt(@Mktmp final Path tmp, final Logs out) - throws IOException { - final FakeMaven mvn = new FakeMaven(tmp) - .withProgram( - "+package com.example\n", - "# No comments.", - "[] > main", - " org.eolang.org > @" - ) - .with("objectionary", new OyRemote(new ChRemote("master"))); - Assertions.assertThrows( - Exception.class, - () -> mvn.execute(new FakeMaven.Pull()), - "Pull mojo should fail, but it does not" - ); - Assertions.assertTrue( - out.captured().stream().anyMatch( - line -> line.contains("Failed to pull 'org.eolang.org' earlier discovered at") - ), - "Log should contain info where failed to pull object was discovered at, but it does not" - ); - } - @Test void skipsAlreadyPulled(@Mktmp final Path temp) throws IOException { final FakeMaven maven = new FakeMaven(temp) diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/RandomProgramResolver.java b/eo-maven-plugin/src/test/java/org/eolang/maven/RandomProgramResolver.java index 8c506b955d..aeb2d3a909 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/RandomProgramResolver.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/RandomProgramResolver.java @@ -48,6 +48,7 @@ public Object resolveParameter(final ParameterContext context, final ExtensionContext ext) { return String.join( "\n", + "+unlint object-has-data\n", "# This is a random program in EO, which supposedly", "# complies with all syntactic rules of the language,", "# include the requirements for comments.", diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java index 3af574bb76..e8dc99faa5 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ShakeMojoTest.java @@ -28,7 +28,6 @@ import com.yegor256.Mktmp; import com.yegor256.MktmpResolver; import com.yegor256.farea.Farea; -import com.yegor256.xsline.TrDefault; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; @@ -46,6 +45,7 @@ import org.eolang.maven.footprint.Saved; import org.eolang.maven.util.HmBase; import org.eolang.parser.EoSyntax; +import org.eolang.parser.TrFull; import org.eolang.xax.XtSticky; import org.eolang.xax.XtStrict; import org.eolang.xax.XtYaml; @@ -99,7 +99,8 @@ void checksShakePacks(final String yaml) { new XtStrict( new XtYaml( yaml, - eo -> new EoSyntax("scenario", String.format("%s\n", eo)).parsed() + eo -> new EoSyntax("scenario", String.format("%s\n", eo)).parsed(), + new TrFull() ) ) ), diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java index fbc7d318bc..dd6e30cf27 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java @@ -106,6 +106,7 @@ void transpilesWithPackage(@Mktmp final Path temp) String.join( "\n", "+package one", + "+unlint object-has-data", "", "# no comments.", "[] > foo", diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/mess.eo b/eo-maven-plugin/src/test/resources/org/eolang/maven/mess.eo index 8cce0e0fc2..98709be939 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/mess.eo +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/mess.eo @@ -28,6 +28,8 @@ +package org.eolang.examples +version 0.0.0 +unlint broken-ref ++unlint broken-alias-second ++unlint object-has-data 3.14 > pi diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml index 9731ef4df7..868df67751 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml @@ -23,11 +23,10 @@ sheets: - /org/eolang/maven/shake/cti-adds-errors.xsl - /org/eolang/maven/shake/add-probes.xsl - - /org/eolang/maven/shake/set-locators.xsl - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - - //metas[count(.//meta[head/text()='probe'])=1] + - //metas[count(.//meta[head/text()='probe'])=2] - /program/sheets[sheet='add-probes'] input: | # No comments. diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml index db7905dece..5cc7099f21 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml @@ -21,20 +21,22 @@ # SOFTWARE. --- sheets: - - /org/eolang/maven/shake/cti-adds-errors.xsl - /org/eolang/maven/shake/add-probes.xsl - - /org/eolang/maven/shake/set-locators.xsl - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] - /program/sheets/sheet[contains(text(),'add-probes')] - - //metas[count(.//meta[head/text()='probe'])=6] + - //metas[count(.//meta[head/text()='probe'])=19] + - //meta[head/text()='probe' and tail/text()='Q.org' and part/text()='Q.org'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang' and part/text()='Q.org.eolang'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang.txt' and part/text()='Q.org.eolang.txt'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang.txt.sprintf' and part/text()='Q.org.eolang.txt.sprintf'] + - //meta[head/text()='probe' and tail/text()='Q.org.eolang.txt.text' and part/text()='Q.org.eolang.txt.text'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang.car' and part/text()='Q.org.eolang.car'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang.car.engine' and part/text()='Q.org.eolang.car.engine'] - //meta[head/text()='probe' and tail/text()='Q.org.eolang.car.engine.start' and part/text()='Q.org.eolang.car.engine.start'] + - //meta[head/text()='probe' and tail/text()='Q.org.eolang.stdout.and' and part/text()='Q.org.eolang.stdout.and'] + - //meta[head/text()='probe' and tail/text()='Q.org.eolang.stdout.and.or' and part/text()='Q.org.eolang.stdout.and.or'] input: | +home https://github.com/objectionary/eo +package org.eolang.custom @@ -42,18 +44,20 @@ input: | # No comments. [] > app + QQ.txt.text.^.q > s QQ.txt.sprintf > @ "Hello, world!\n" start. > a engine. QQ.car - and. > fib - stdout - sprintf - "%dth Fibonacci number is %d\n" - n - fibonacci n > f - true + or. > fib + and. + stdout + sprintf + "%dth Fibonacci number is %d\n" + n + fibonacci n > f + true # No comments. [i] > other diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml index 007b9a8987..074358a791 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml @@ -23,7 +23,6 @@ sheets: - /org/eolang/maven/shake/cti-adds-errors.xsl - /org/eolang/maven/shake/add-probes.xsl - - /org/eolang/maven/shake/set-locators.xsl - /org/eolang/maven/shake/blank-xsd-schema.xsl asserts: - /program[not(errors)] @@ -32,4 +31,3 @@ asserts: input: | # No comments. [] > app - 42 > @ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml index f75fcc2e63..165b80ce4f 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/embedded-class.yaml @@ -30,10 +30,11 @@ asserts: - //java[contains(text(), 'this.add("xyz",')] - //java[contains(text(), '((PhDefault) r).add("bar",')] - //java[contains(text(), '((PhDefault) rr).add("φ",')] - - //java[contains(text(), 'Phi rrrbbb = rrh.take("ρ")')] - - //java[contains(text(), 'Phi rrrbb = rrrbbb.take("ρ")')] - - //java[contains(text(), 'Phi rrrb = new PhMethod(rrrbb, "this")')] - - //java[contains(text(), 'Phi rrr = new PhMethod(rrrb, "x")')] + - //java[contains(text(), 'Phi rrr = rrh.take("ρ")')] + - //java[contains(text(), 'rrr = rrr.take("ρ")')] + - //java[contains(text(), 'rrr = new PhMethod(rrr, "this")')] + - //java[contains(text(), 'rrr = new PhMethod(rrr, "x")')] + - //java[contains(text(), 'return rrr;')] input: | # No comments. [x] > foo diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/fetching.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/fetching.yaml new file mode 100644 index 0000000000..1debf11175 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/fetching.yaml @@ -0,0 +1,46 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +sheets: + - /org/eolang/maven/transpile/classes.xsl + - /org/eolang/maven/transpile/package.xsl + - /org/eolang/maven/transpile/attrs.xsl + - /org/eolang/maven/transpile/data.xsl + - /org/eolang/maven/transpile/to-java.xsl +asserts: + - /program[not(errors)] + - //java[contains(text(), 'Phi rb = new PhMethod(h, "x");')] + - //java[contains(text(), 'rb = rb.take("ρ");')] + - //java[contains(text(), 'rb = new PhMethod(rb, "or");')] + - //java[contains(text(), 'rb = new PhCopy(rb);')] + - //java[contains(text(), 'Phi rb1 = Phi.Φ.take("org").take("eolang").take("number");')] + - //java[contains(text(), 'Phi rb11 = Phi.Φ.take("org").take("eolang").take("bytes").copy();')] + - //java[contains(text(), 'Phi r = new PhMethod(rb, "and");')] +input: | + # Comment. + [] > foo + and. > q + or. + ^. + x. + $ + 2 diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tuple-to-java.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tuple-to-java.yaml index 47120624e0..fcb737295a 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tuple-to-java.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/tuple-to-java.yaml @@ -27,9 +27,7 @@ sheets: - /org/eolang/maven/transpile/to-java.xsl asserts: - /program[not(errors)] - - //java[contains(text(), ' Phi rbbbb = Phi.Φ.take("org").take("eolang").take("tuple");')] - - //java[contains(text(), ' Phi rbbb = new PhMethod(rbbbb, "empty");')] - - //java[contains(text(), ' Phi rbbb = new PhMethod(rbbbb, "empty");')] + - //java[contains(text(), ' Phi rbb = Phi.Φ.take("org").take("eolang").take("tuple").take("empty").take("with");')] - //java[contains(text(), ' rbb = new PhWith(rbb, 0, rbb1);')] - //java[contains(text(), ' Phi rb = new PhMethod(rbb, "with");')] - //java[contains(text(), ' rb = new PhWith(rb, 0, rb1);')] diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/bindings.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/bindings.yaml index 37f356f8b2..9b0a0035e2 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/bindings.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/bindings.yaml @@ -21,13 +21,10 @@ # SOFTWARE. --- asserts: - - //o[@base='.x' and @name='xyz']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] - - //o[@base='.x' and @name='xyz']/o[@base='.y' and @as='attr']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] - - //o[@base='.x' and @name='xyz']/o[not(@base) and @as='abs']/o[@name='z' and @base='∅'] - - //o[@base='.x' and @name='xyz']/o[not(@base) and @as='abs']/o[@base='.w' and @name='@']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] - - //o[@base='.x' and @name='xyz']/o[@base='.int' and @as='five']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] - - //o[@base='.x' and @name='xyz']/o[@base='.int' and @as='five']/o[@as='α0' and @base='.bytes']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] - - //o[@base='.x' and @name='xyz']/o[@base='.int' and @as='five']/o[@as='α0' and @base='.bytes' and text()!=''] + - //o[@base='Q.org.eolang.x' and @name='xyz']/o[1][@as='attr' and @base='Q.org.eolang.y'] + - //o[@name='xyz']/o[2][@as='abs']/o[1][@base='∅' and @name='z'] + - //o[@name='xyz']/o[2][@as='abs']/o[2][@base='Q.org.eolang.w' and @name='@'] + - //o[@name='xyz']/o[3][@as='five' and @base='Q.org.eolang.int']/o[1][@as='α0' and @base='Q.org.eolang.bytes' and text()!=''] phi: |- { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/delta-in-formation.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/delta-in-formation.yaml index 08876ecf7d..4438ee17c7 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/delta-in-formation.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/delta-in-formation.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- asserts: - - //o[@name='x' and @base='org.eolang.bytes' and text()='01-'] + - //o[@name='x' and @base='Q.org.eolang.bytes' and text()='01-'] phi: | { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/empty-bytes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/empty-bytes.yaml index 5d45c2e3c9..2243df755c 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/empty-bytes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/empty-bytes.yaml @@ -21,5 +21,5 @@ # SOFTWARE. --- asserts: - - /program/objects/o[@base='.bytes' and @name='empty' and text()='--']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] + - //o[@name='empty' and @base='Q.org.eolang.bytes' and text()='--'] phi: "{⟦empty ↦ Φ.org.eolang.bytes(α0 ↦ ⟦Δ ⤍ --⟧)⟧}" diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/inline-application.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/inline-application.yaml index 621d8ed08c..b5abea7a01 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/inline-application.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/inline-application.yaml @@ -21,14 +21,12 @@ # SOFTWARE. --- asserts: - - //o[@base='.foo' and @name='xyz']/o[1][@base='Q'] - - //o[@base='.foo' and @name='xyz']/o[@as='α0' and @base='org.eolang.string']/o[@base='org.eolang.bytes' and text()='48-65-6C-6C-6F'] - - //o[@base='.foo' and @name='xyz']/o[@as='α1' and @base='org.eolang.string']/o[@base='org.eolang.bytes' and text()='77-6F-72-6C-64'] - - //o[@base='.foo' and @name='xyz']/o[@as='α2' and @base='.plus']/o[1][@base='org.eolang.number' and not(@as)]/o[@base='org.eolang.bytes' and text()='40-45-00-00-00-00-00-00'] - - //o[@base='.foo' and @name='xyz']/o[@as='α2' and @base='.plus']/o[@base='org.eolang.number' and @as='α0']/o[@base='org.eolang.bytes' and text()='40-41-80-00-00-00-00-00'] - - //o[@base='.foo' and @name='xyz']/o[@as='α3' and @base='.some']/o[1][@base='org.eolang.number' and not(@as)]/o[@base='org.eolang.bytes' and text()='40-3F-19-99-99-99-99-9A'] - - //o[@base='.foo' and @name='xyz']/o[@as='α3' and @base='.some']/o[@base='.y' and @as='α0']/o[1][@base='Q'] - - //o[@base='.foo' and @name='xyz']/o[@as='α3' and @base='.some']/o[@base='.y' and @as='α0']/o[@base='org.eolang.number' and @as='α0']/o[@base='org.eolang.bytes' and text()='40-26-00-00-00-00-00-00'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α0' and @base='Q.org.eolang.string']/o[@base='Q.org.eolang.bytes' and text()='48-65-6C-6C-6F'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α1' and @base='Q.org.eolang.string']/o[@base='Q.org.eolang.bytes' and text()='77-6F-72-6C-64'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α2' and @base='.plus']/o[1][@base='Q.org.eolang.number' and not(@as)]/o[@base='Q.org.eolang.bytes' and text()='40-45-00-00-00-00-00-00'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α2' and @base='.plus']/o[@base='Q.org.eolang.number' and @as='α0']/o[@base='Q.org.eolang.bytes' and text()='40-41-80-00-00-00-00-00'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α3' and @base='.some']/o[1][@base='Q.org.eolang.number' and not(@as)]/o[@base='Q.org.eolang.bytes' and text()='40-3F-19-99-99-99-99-9A'] + - //o[@base='Q.foo' and @name='xyz']/o[@as='α3' and @base='.some']/o[@base='Q.y' and @as='α0']/o[@base='Q.org.eolang.number' and @as='α0']/o[@base='Q.org.eolang.bytes' and text()='40-26-00-00-00-00-00-00'] phi: |- { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/normalized-atom.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/normalized-atom.yaml index 1ebde06ea7..fae3cfbed8 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/normalized-atom.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/normalized-atom.yaml @@ -21,9 +21,9 @@ # SOFTWARE. --- asserts: - - //o[@base='org.eolang.io.stdout' and @name='x']/o[@as='text' and @base='.bytes'] - - //o[@base='org.eolang.io.stdout' and @name='x']/o[@as='size' and @base='.int'] - - //o[@base='org.eolang.malloc.@' and @name='y']/o[@as='arg' and @base='.nan'] + - //o[@base='Q.org.eolang.io.stdout' and @name='x']/o[@as='text' and @base='Q.org.eolang.bytes'] + - //o[@base='Q.org.eolang.io.stdout' and @name='x']/o[@as='size' and @base='Q.org.eolang.int'] + - //o[@base='Q.org.eolang.malloc.@' and @name='y']/o[@as='arg' and @base='Q.org.eolang.nan'] phi: | { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/one-byte.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/one-byte.yaml index 9bd5dcffed..1f6a84d855 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/one-byte.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/one-byte.yaml @@ -21,5 +21,5 @@ # SOFTWARE. --- asserts: - - /program/objects/o[@base='.bytes' and @name='bts' and text()='A2-']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] + - /program/objects/o[@base='Q.org.eolang.bytes' and @name='bts' and text()='A2-'] phi: "{⟦bts ↦ Φ.org.eolang.bytes(α0 ↦ ⟦Δ ⤍ A2-⟧)⟧}" diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/package.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/package.yaml index e10e42ca28..e1b4102a60 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/package.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/package.yaml @@ -22,5 +22,5 @@ --- asserts: - /program/metas/meta[head[text()='package'] and tail[text()='foo.bar.baz'] and part[text()='foo.bar.baz']] - - //o[not(@base) and @name='main']/o[@base='.stdout']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] + - //o[not(@base) and @name='main']/o[@base='Q.org.eolang.stdout'] phi: "{⟦foo ↦ ⟦bar ↦ ⟦baz ↦ ⟦main ↦ ⟦φ ↦ Φ.org.eolang.stdout⟧, λ ⤍ Package⟧, λ ⤍ Package⟧, λ ⤍ Package⟧⟧}" diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/pretty-data.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/pretty-data.yaml index c497798753..bda2a74553 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/pretty-data.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/pretty-data.yaml @@ -21,6 +21,6 @@ # SOFTWARE. --- asserts: - - //o[@name='five' and @base='org.eolang.number']/o[@base='org.eolang.bytes' and text()='40-14-00-00-00-00-00-00'] - - //o[@name='hello' and @base='org.eolang.string']/o[@base='org.eolang.bytes' and text()='48-65-6C-6C-6F'] + - //o[@name='five' and @base='Q.org.eolang.number']/o[@base='Q.org.eolang.bytes' and text()='40-14-00-00-00-00-00-00'] + - //o[@name='hello' and @base='Q.org.eolang.string']/o[@base='Q.org.eolang.bytes' and text()='48-65-6C-6C-6F'] phi: "{⟦five ↦ 5, hello ↦ \"Hello\"⟧}" diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/specials.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/specials.yaml index 9cfd72b702..f787aff9e0 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/specials.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/specials.yaml @@ -22,9 +22,9 @@ --- asserts: - /program/objects/o[@name='main'] - - /program/objects/o[not(@base) and @name='main']/o[@base='.x' and @name='x']/o[@base='.^']/o[@base='$'] - - /program/objects/o[not(@base) and @name='main']/o[@base='.a' and @name='a']/o[@base='.^']/o[@base='$'] - - /program/objects/o[not(@base) and @name='main']/o[@base='.@' and @name='phi']/o[@base='.@']/o[@base='$'] + - /program/objects/o[not(@base) and @name='main']/o[@base='$.^.x' and @name='x'] + - /program/objects/o[not(@base) and @name='main']/o[@base='$.^.a' and @name='a'] + - /program/objects/o[not(@base) and @name='main']/o[@base='$.@.@' and @name='phi'] input: | [] > main ^.x > x diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination-with-tail.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination-with-tail.yaml index 2c9afb0793..0ef73baa96 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination-with-tail.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination-with-tail.yaml @@ -21,8 +21,8 @@ # SOFTWARE. --- asserts: - - /program/objects/o[@base='.m' and @name='x']/o[@base='org.eolang.error'] - - /program/objects/o[@base='org.eolang.error' and @name='y']/o[@as='α0' and @base='.x']/o[@base='$'] + - /program/objects/o[@base='Q.org.eolang.error.m' and @name='x'] + - /program/objects/o[@base='Q.org.eolang.error' and @name='y']/o[@as='α0' and @base='$.x'] phi: | { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination.yaml index a20112f7e1..2d13ab308b 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/termination.yaml @@ -21,7 +21,7 @@ # SOFTWARE. --- asserts: - - //o[@base='org.eolang.error' and @name='x' and not(o)] + - //o[@base='Q.org.eolang.error' and @name='x' and not(o)] phi: | { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-anonym-abstract.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-anonym-abstract.yaml index 7106b821e5..744dea4b77 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-anonym-abstract.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-anonym-abstract.yaml @@ -21,8 +21,8 @@ # SOFTWARE. --- asserts: - - //o[@name='test' and not(@base)]/o[@base='.plus' and @name='s']/o[position()=1 and not(@base) and not(@name)] - - //o[@name='test' and not(@base)]/o[@base='.plus' and @name='s']/o[position()>1 and @as='α0' and @base='.int']/o[@base='.eolang']/o[@base='.org']/o[@base='Q'] + - //o[@name='test' and not(@base)]/o[@base='.plus' and @name='s']/o[1][not(@base) and not(@name)] + - //o[@name='test' and not(@base)]/o[@base='.plus' and @name='s']/o[2][@as='α0' and @base='Q.org.eolang.int'] phi: |- { ⟦ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-data.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-data.yaml index fc9b474cae..91ebc7dfd9 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-data.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi-packs/with-data.yaml @@ -21,6 +21,5 @@ # SOFTWARE. --- asserts: - - //o[@name='five' and @base='.int']/o[@base='.eolang'] - - //o[@name='five' and @base='.int']/o[@base='.bytes' and @as='α0'] + - //o[@name='five' and @base='Q.org.eolang.int']/o[@base='Q.org.eolang.bytes' and @as='α0'] phi: "{⟦five ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(α0 ↦ ⟦Δ ⤍ 00-00-00-00-00-00-00-05⟧))⟧}" diff --git a/eo-parser/src/main/resources/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl b/eo-parser/src/main/resources/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl index d727d0b70f..34cee8ba15 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/unphi/atoms-with-bound-attrs.xsl @@ -45,6 +45,7 @@ SOFTWARE. + Q. @@ -66,9 +67,7 @@ SOFTWARE. - - - + diff --git a/eo-runtime/src/main/eo/org/eolang/tuple.eo b/eo-runtime/src/main/eo/org/eolang/tuple.eo index 25a08454a4..a066bceceb 100644 --- a/eo-runtime/src/main/eo/org/eolang/tuple.eo +++ b/eo-runtime/src/main/eo/org/eolang/tuple.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # Tuple. # An ordered, immutable collection of elements. From b8a5a1e2fcc7ae5fb45e19b980148a299e943147 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 29 Jan 2025 19:04:38 +0300 Subject: [PATCH 11/12] bug(#3845): unlints in runtime --- .../java/org/eolang/maven/AssembleMojo.java | 1 - .../main/java/org/eolang/maven/ProbeMojo.java | 1 - .../org/eolang/maven/shake/add-probes.xsl | 13 +++++-- .../eolang/maven/shake/cti-adds-errors.xsl | 23 ++++++----- .../org/eolang/maven/transpile/to-java.xsl | 1 + .../test/java/org/eolang/maven/FakeMaven.java | 2 - .../java/org/eolang/maven/ProbeMojoTest.java | 1 - .../maven/hash/CommitHashesTextTest.java | 27 +++---------- .../maven/shake-packs/cti-adds-warning.yaml | 17 ++++++++- .../{ => locators}/add-locators.yaml | 0 .../{ => locators}/add-locs-with-dot.yml | 0 .../shake-packs/{ => locators}/add-locs.yml | 0 .../{ => probes}/add-probes-to-empty.yaml | 0 .../shake-packs/{ => probes}/add-probes.yaml | 0 .../{ => probes}/adds-no-probes.yaml | 0 .../probes/probes-to-anonym-abstract.yaml | 38 +++++++++++++++++++ .../org/eolang/maven/sodgs/data.yaml | 1 + .../org/eolang/maven/sodgs/simple.yaml | 1 + eo-runtime/src/main/eo/org/eolang/bytes.eo | 2 + eo-runtime/src/main/eo/org/eolang/cti.eo | 1 + eo-runtime/src/main/eo/org/eolang/dataized.eo | 1 + eo-runtime/src/main/eo/org/eolang/error.eo | 1 + eo-runtime/src/main/eo/org/eolang/false.eo | 1 + eo-runtime/src/main/eo/org/eolang/fs/dir.eo | 2 + eo-runtime/src/main/eo/org/eolang/fs/file.eo | 2 + eo-runtime/src/main/eo/org/eolang/fs/path.eo | 3 ++ .../src/main/eo/org/eolang/fs/tmpdir.eo | 3 ++ eo-runtime/src/main/eo/org/eolang/go.eo | 1 + eo-runtime/src/main/eo/org/eolang/i16.eo | 2 + eo-runtime/src/main/eo/org/eolang/i32.eo | 2 + eo-runtime/src/main/eo/org/eolang/i64.eo | 2 + .../main/eo/org/eolang/io/bytes-as-input.eo | 1 + .../src/main/eo/org/eolang/io/console.eo | 3 ++ .../src/main/eo/org/eolang/io/dead-input.eo | 1 + .../src/main/eo/org/eolang/io/dead-output.eo | 1 + .../src/main/eo/org/eolang/io/input-length.eo | 1 + .../main/eo/org/eolang/io/malloc-as-output.eo | 1 + eo-runtime/src/main/eo/org/eolang/io/stdin.eo | 3 ++ .../src/main/eo/org/eolang/io/stdout.eo | 3 ++ .../src/main/eo/org/eolang/io/tee-input.eo | 1 + eo-runtime/src/main/eo/org/eolang/malloc.eo | 1 + .../src/main/eo/org/eolang/math/angle.eo | 2 + eo-runtime/src/main/eo/org/eolang/math/e.eo | 1 + .../src/main/eo/org/eolang/math/integral.eo | 1 + .../src/main/eo/org/eolang/math/numbers.eo | 2 + eo-runtime/src/main/eo/org/eolang/math/pi.eo | 1 + .../src/main/eo/org/eolang/math/random.eo | 3 ++ .../src/main/eo/org/eolang/math/real.eo | 2 + eo-runtime/src/main/eo/org/eolang/nan.eo | 1 + .../main/eo/org/eolang/negative-infinity.eo | 1 + .../src/main/eo/org/eolang/net/socket.eo | 3 ++ eo-runtime/src/main/eo/org/eolang/number.eo | 1 + .../main/eo/org/eolang/positive-infinity.eo | 1 + eo-runtime/src/main/eo/org/eolang/seq.eo | 1 + eo-runtime/src/main/eo/org/eolang/string.eo | 2 + .../eo/org/eolang/structs/bytes-as-array.eo | 1 + .../eo/org/eolang/structs/hash-code-of.eo | 1 + .../src/main/eo/org/eolang/structs/list.eo | 1 + .../src/main/eo/org/eolang/structs/map.eo | 2 + .../eo/org/eolang/structs/range-of-ints.eo | 2 + .../src/main/eo/org/eolang/structs/range.eo | 2 + .../src/main/eo/org/eolang/structs/set.eo | 2 + eo-runtime/src/main/eo/org/eolang/switch.eo | 1 + .../src/main/eo/org/eolang/sys/getenv.eo | 3 ++ .../main/eo/org/eolang/sys/line-separator.eo | 3 ++ eo-runtime/src/main/eo/org/eolang/sys/os.eo | 2 + .../src/main/eo/org/eolang/sys/posix.eo | 1 + .../src/main/eo/org/eolang/sys/win32.eo | 1 + eo-runtime/src/main/eo/org/eolang/true.eo | 1 + eo-runtime/src/main/eo/org/eolang/try.eo | 1 + eo-runtime/src/main/eo/org/eolang/tuple.eo | 1 + .../src/main/eo/org/eolang/txt/regex.eo | 1 + .../src/main/eo/org/eolang/txt/sprintf.eo | 1 + .../src/main/eo/org/eolang/txt/sscanf.eo | 1 + eo-runtime/src/main/eo/org/eolang/txt/text.eo | 5 ++- eo-runtime/src/main/eo/org/eolang/while.eo | 1 + .../src/test/eo/org/eolang/bool-tests.eo | 1 + .../src/test/eo/org/eolang/bytes-tests.eo | 1 + eo-runtime/src/test/eo/org/eolang/cti-test.eo | 1 + .../src/test/eo/org/eolang/dataized-tests.eo | 1 + .../src/test/eo/org/eolang/fs/dir-tests.eo | 3 ++ .../src/test/eo/org/eolang/fs/file-tests.eo | 3 ++ .../src/test/eo/org/eolang/fs/path-tests.eo | 3 ++ .../src/test/eo/org/eolang/fs/tmpdir-tests.eo | 3 ++ eo-runtime/src/test/eo/org/eolang/go-tests.eo | 1 + .../src/test/eo/org/eolang/i16-tests.eo | 1 + .../src/test/eo/org/eolang/i32-tests.eo | 1 + .../src/test/eo/org/eolang/i64-tests.eo | 1 + .../eo/org/eolang/io/bytes-as-input-test.eo | 2 + .../src/test/eo/org/eolang/io/console-test.eo | 3 ++ .../test/eo/org/eolang/io/dead-input-tests.eo | 3 ++ .../eo/org/eolang/io/dead-output-tests.eo | 3 ++ .../eo/org/eolang/io/input-length-tests.eo | 2 + .../eo/org/eolang/io/malloc-as-output-test.eo | 2 + .../src/test/eo/org/eolang/io/stdout-test.eo | 2 + .../test/eo/org/eolang/io/tee-input-tests.eo | 2 + .../src/test/eo/org/eolang/malloc-tests.eo | 1 + .../test/eo/org/eolang/math/angle-tests.eo | 2 + .../test/eo/org/eolang/math/integral-tests.eo | 2 + .../test/eo/org/eolang/math/numbers-tests.eo | 2 + .../test/eo/org/eolang/math/random-tests.eo | 2 + .../src/test/eo/org/eolang/math/real-tests.eo | 2 + .../src/test/eo/org/eolang/nan-tests.eo | 1 + .../eo/org/eolang/negative-infinity-tests.eo | 1 + .../src/test/eo/org/eolang/number-tests.eo | 1 + .../eo/org/eolang/positive-infinity-tests.eo | 1 + .../src/test/eo/org/eolang/runtime-tests.eo | 1 + .../src/test/eo/org/eolang/seq-tests.eo | 1 + .../src/test/eo/org/eolang/string-tests.eo | 1 + .../eolang/structs/bytes-as-array-tests.eo | 2 + .../org/eolang/structs/hash-code-of-tests.eo | 2 + .../test/eo/org/eolang/structs/list-tests.eo | 2 + .../test/eo/org/eolang/structs/map-tests.eo | 3 ++ .../org/eolang/structs/range-of-ints-tests.eo | 2 + .../test/eo/org/eolang/structs/range-tests.eo | 2 + .../test/eo/org/eolang/structs/set-tests.eo | 2 + .../src/test/eo/org/eolang/switch-tests.eo | 1 + .../src/test/eo/org/eolang/sys/os-tests.eo | 3 ++ .../src/test/eo/org/eolang/sys/posix-tests.eo | 3 ++ .../src/test/eo/org/eolang/sys/win32-tests.eo | 3 ++ .../src/test/eo/org/eolang/try-tests.eo | 1 + .../src/test/eo/org/eolang/tuple-tests.eo | 1 + .../src/test/eo/org/eolang/txt/regex-tests.eo | 2 + .../test/eo/org/eolang/txt/sprintf-tests.eo | 2 + .../test/eo/org/eolang/txt/sscanf-tests.eo | 3 ++ .../src/test/eo/org/eolang/txt/text-tests.eo | 2 + .../src/test/eo/org/eolang/while-tests.eo | 1 + .../resources/org/eolang/snippets/fibo.yaml | 2 + 128 files changed, 275 insertions(+), 42 deletions(-) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => locators}/add-locators.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => locators}/add-locs-with-dot.yml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => locators}/add-locs.yml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => probes}/add-probes-to-empty.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => probes}/add-probes.yaml (100%) rename eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/{ => probes}/adds-no-probes.yaml (100%) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/probes-to-anonym-abstract.yaml diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java index ff5e843664..45cb664c13 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/AssembleMojo.java @@ -235,7 +235,6 @@ public void exec() { final Moja[] mojas = { new Moja<>(ParseMojo.class), new Moja<>(ShakeMojo.class), -// new Moja<>(DiscoverMojo.class), new Moja<>(ProbeMojo.class), new Moja<>(PullMojo.class), new Moja<>(ResolveMojo.class), diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java index d77cfdaa7d..9fc3e30e6e 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/ProbeMojo.java @@ -110,7 +110,6 @@ private void probe() throws IOException { for (final ForeignTojo tojo : tojos) { final Path src = tojo.shaken(); final Collection objects = this.probes(src); - System.out.println(objects); if (!objects.isEmpty()) { Logger.debug(this, "Probing object(s): %s", objects); } diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl index 1a5ca1fb33..b303186949 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/add-probes.xsl @@ -118,18 +118,23 @@ SOFTWARE. - + + + + - - - + + + + + diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl index 0068dd7908..e2506c2255 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/shake/cti-adds-errors.xsl @@ -52,9 +52,9 @@ SOFTWARE.
- + - +
@@ -65,19 +65,22 @@ SOFTWARE. - 0123456789ABCDEF + - - + + + - + - - - - + + + + + + diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl index ca9f408022..bdbaac29db 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/transpile/to-java.xsl @@ -512,6 +512,7 @@ SOFTWARE. + ; diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java index 39ed0d2cae..5e06c53928 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java @@ -712,7 +712,6 @@ public Iterator> iterator() { return Arrays.>asList( ParseMojo.class, ShakeMojo.class, -// DiscoverMojo.class, ProbeMojo.class ).iterator(); } @@ -730,7 +729,6 @@ public Iterator> iterator() { return Arrays.>asList( ParseMojo.class, ShakeMojo.class, -// DiscoverMojo.class, ProbeMojo.class, PullMojo.class ).iterator(); diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java index 836ae3603d..75a81573dc 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ProbeMojoTest.java @@ -30,7 +30,6 @@ import java.nio.file.Path; import java.nio.file.Paths; import org.cactoos.io.ResourceOf; -import org.eolang.maven.footprint.Saved; import org.eolang.maven.hash.ChCached; import org.eolang.maven.hash.ChRemote; import org.eolang.maven.hash.ChText; 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 62efe50061..efcbe71e4e 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 @@ -23,11 +23,8 @@ */ package org.eolang.maven.hash; +import com.yegor256.Together; import com.yegor256.WeAreOnline; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import org.cactoos.Scalar; -import org.cactoos.experimental.Threads; import org.hamcrest.MatcherAssert; import org.hamcrest.Matchers; import org.junit.jupiter.api.Test; @@ -37,15 +34,11 @@ * Test case for {@link CommitHashesText}. * * @since 0.37.0 - * @todo #3122:60min Add "Reload" to the test CommitHashesTextTest#isThreadSafe - * when issue about "Reload" annotation will be solved. - * We need to reinitialize some static fields of the class - * before the test will be executed. */ +@ExtendWith(WeAreOnline.class) final class CommitHashesTextTest { @Test - @ExtendWith(WeAreOnline.class) void downloadsDefaultList() throws Exception { MatcherAssert.assertThat( "CommitHashesText downloads the default list of hashes from Objectionary", @@ -56,20 +49,12 @@ void downloadsDefaultList() throws Exception { @Test void isThreadSafe() { - final int threads = 200; - boolean nonulls = true; - for (final boolean bool: new Threads<>( - threads, - Stream.generate( - () -> (Scalar) () -> new CommitHashesText().asString() != null - ).limit(threads).collect(Collectors.toList()) - )) { - nonulls &= bool; - } MatcherAssert.assertThat( "Can be used in different threads without NPE", - nonulls, - Matchers.equalTo(true) + new Together<>( + thread -> new CommitHashesText().asString() != null + ), + Matchers.not(Matchers.hasItems(false)) ); } } diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml index dc670f2594..0c09112161 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/cti-adds-warning.yaml @@ -22,13 +22,28 @@ --- sheets: - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/set-locators.xsl asserts: - - /program/errors[count(*)=1] + - /program/errors[count(*)=2] - /program/errors/error[@check='cti'] - /program/errors/error[@severity='warning'] - /program/errors/error[text()='This method is deprecated!'] input: | + +package org.eolang + +version 0.0.0 + +unlint object-has-data + + # This unit test is supposed to check the functionality of the corresponding object. + [] > just-prints-warning + eq. > @ + cti + 2.times 2 + "warning" + "This method is deprecated!" + 4 + # No comments. [] > foo cti > @ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locators.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locators.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locators.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locs-with-dot.yml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs-with-dot.yml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locs-with-dot.yml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locs.yml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-locs.yml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/locators/add-locs.yml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/add-probes-to-empty.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes-to-empty.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/add-probes-to-empty.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/add-probes.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/add-probes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/add-probes.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/adds-no-probes.yaml similarity index 100% rename from eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/adds-no-probes.yaml rename to eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/adds-no-probes.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/probes-to-anonym-abstract.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/probes-to-anonym-abstract.yaml new file mode 100644 index 0000000000..b32cf53b45 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/shake-packs/probes/probes-to-anonym-abstract.yaml @@ -0,0 +1,38 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2025 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +sheets: + - /org/eolang/maven/shake/cti-adds-errors.xsl + - /org/eolang/maven/shake/add-probes.xsl + - /org/eolang/maven/shake/blank-xsd-schema.xsl +asserts: + - /program[not(errors)] + - /program/sheets[sheet='add-probes'] + - /program/metas[count(meta[head='probe'])=3] + - /program/metas/meta[head='probe' and tail='Q.org'] + - /program/metas/meta[head='probe' and tail='Q.org.eolang'] + - /program/metas/meta[head='probe' and tail='Q.org.eolang.int'] +input: | + # No comments. + [] > test + ([] (^ > x)).plus.minus > s + int diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/data.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/data.yaml index e6d1d7e755..224617f1a5 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/data.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/data.yaml @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- +skip: true locators: - .data .f .α0 .Δ δ=40-09-21-FB-4D-12-D8-4A - .data .f .π >number diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/simple.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/simple.yaml index 45083881ef..876d5d30f1 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/simple.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/sodgs/simple.yaml @@ -20,6 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. --- +skip: true locators: - .org .eolang .number - .org .eolang .true diff --git a/eo-runtime/src/main/eo/org/eolang/bytes.eo b/eo-runtime/src/main/eo/org/eolang/bytes.eo index 3be05948ed..67ccb39dd4 100644 --- a/eo-runtime/src/main/eo/org/eolang/bytes.eo +++ b/eo-runtime/src/main/eo/org/eolang/bytes.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The object encapsulates a chain of bytes, adding a few # convenient operations to it. Objects like `int`, `string`, diff --git a/eo-runtime/src/main/eo/org/eolang/cti.eo b/eo-runtime/src/main/eo/org/eolang/cti.eo index 677d3f8591..381b7f7f74 100644 --- a/eo-runtime/src/main/eo/org/eolang/cti.eo +++ b/eo-runtime/src/main/eo/org/eolang/cti.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # Compile Time Instruction (CTI). # diff --git a/eo-runtime/src/main/eo/org/eolang/dataized.eo b/eo-runtime/src/main/eo/org/eolang/dataized.eo index aff7d479d7..51c210dbc3 100644 --- a/eo-runtime/src/main/eo/org/eolang/dataized.eo +++ b/eo-runtime/src/main/eo/org/eolang/dataized.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The object dataizes `target`, makes new instance of `bytes` from given data and behaves as result # `bytes`. diff --git a/eo-runtime/src/main/eo/org/eolang/error.eo b/eo-runtime/src/main/eo/org/eolang/error.eo index 202d239e5b..d2eb81b88a 100644 --- a/eo-runtime/src/main/eo/org/eolang/error.eo +++ b/eo-runtime/src/main/eo/org/eolang/error.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # This object must be used in order to terminate the program # due to an error. Just make a copy of it with any encapsulated object. diff --git a/eo-runtime/src/main/eo/org/eolang/false.eo b/eo-runtime/src/main/eo/org/eolang/false.eo index 15dc071800..6c47d9c4d0 100644 --- a/eo-runtime/src/main/eo/org/eolang/false.eo +++ b/eo-runtime/src/main/eo/org/eolang/false.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The object is a FALSE boolean state. [] > false diff --git a/eo-runtime/src/main/eo/org/eolang/fs/dir.eo b/eo-runtime/src/main/eo/org/eolang/fs/dir.eo index 224c095918..16edeb423c 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/dir.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/dir.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Directory in the file system. # Apparently every directory is a file. diff --git a/eo-runtime/src/main/eo/org/eolang/fs/file.eo b/eo-runtime/src/main/eo/org/eolang/fs/file.eo index f159249d90..dbeb865412 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/file.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/file.eo @@ -27,7 +27,9 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second # The file object in the filesystem. [path] > file diff --git a/eo-runtime/src/main/eo/org/eolang/fs/path.eo b/eo-runtime/src/main/eo/org/eolang/fs/path.eo index d067baa69e..e5931e9880 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/path.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/path.eo @@ -30,7 +30,10 @@ +home https://github.com/objectionary/eo +package org.eolang.fs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second ++unlint unused-alias # A `path` represents a path that is hierarchical and composed of a sequence of # directory and file name elements separated by a special separator or delimiter. diff --git a/eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo b/eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo index cce5dc8cc1..99f233b552 100644 --- a/eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo +++ b/eo-runtime/src/main/eo/org/eolang/fs/tmpdir.eo @@ -28,7 +28,10 @@ +home https://github.com/objectionary/eo +package org.eolang.fs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second ++unlint unused-alias # Temporary directory. # For Unix/MacOS uses the path supplied by the first environment variable diff --git a/eo-runtime/src/main/eo/org/eolang/go.eo b/eo-runtime/src/main/eo/org/eolang/go.eo index eb500f5e90..54bd649701 100644 --- a/eo-runtime/src/main/eo/org/eolang/go.eo +++ b/eo-runtime/src/main/eo/org/eolang/go.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # Non-conditional forward and backward jumps. diff --git a/eo-runtime/src/main/eo/org/eolang/i16.eo b/eo-runtime/src/main/eo/org/eolang/i16.eo index f7f2ca667a..42f094432d 100644 --- a/eo-runtime/src/main/eo/org/eolang/i16.eo +++ b/eo-runtime/src/main/eo/org/eolang/i16.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The 16 bits signed integer. # Here `as-bytes` must be a `bytes` object. diff --git a/eo-runtime/src/main/eo/org/eolang/i32.eo b/eo-runtime/src/main/eo/org/eolang/i32.eo index 5c51d548ea..f9d5670e16 100644 --- a/eo-runtime/src/main/eo/org/eolang/i32.eo +++ b/eo-runtime/src/main/eo/org/eolang/i32.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The 32 bits signed integer. # Here `as-bytes` must be a `bytes` object. diff --git a/eo-runtime/src/main/eo/org/eolang/i64.eo b/eo-runtime/src/main/eo/org/eolang/i64.eo index 539755b75d..ad55511073 100644 --- a/eo-runtime/src/main/eo/org/eolang/i64.eo +++ b/eo-runtime/src/main/eo/org/eolang/i64.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The 64 bits signed integer. # Here `as-bytes` must be a `bytes` object. diff --git a/eo-runtime/src/main/eo/org/eolang/io/bytes-as-input.eo b/eo-runtime/src/main/eo/org/eolang/io/bytes-as-input.eo index 3e299a4e2a..e8f3955112 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/bytes-as-input.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/bytes-as-input.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Makes an `input` from bytes. # Here `bts` is sequence of bytes or an object that can be dataized diff --git a/eo-runtime/src/main/eo/org/eolang/io/console.eo b/eo-runtime/src/main/eo/org/eolang/io/console.eo index 509d4c1a5d..a42af81490 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/console.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/console.eo @@ -27,6 +27,9 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # The `console` object is basic I/O object that allows to # interact with operation system console. diff --git a/eo-runtime/src/main/eo/org/eolang/io/dead-input.eo b/eo-runtime/src/main/eo/org/eolang/io/dead-input.eo index d170617b96..1d134533c3 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/dead-input.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/dead-input.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Dead input is an input that reads from nowhere and always # returns empty sequence of bytes `--`. diff --git a/eo-runtime/src/main/eo/org/eolang/io/dead-output.eo b/eo-runtime/src/main/eo/org/eolang/io/dead-output.eo index 90fcb3ce29..e2310c89fa 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/dead-output.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/dead-output.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Dead output is an output that writes to nowhere. [] > dead-output diff --git a/eo-runtime/src/main/eo/org/eolang/io/input-length.eo b/eo-runtime/src/main/eo/org/eolang/io/input-length.eo index e7dd64619b..5a7327de55 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/input-length.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/input-length.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Reads all the bytes from provided `input` and returns its length. [input] > input-length diff --git a/eo-runtime/src/main/eo/org/eolang/io/malloc-as-output.eo b/eo-runtime/src/main/eo/org/eolang/io/malloc-as-output.eo index 786f75629b..fd74e5f0d7 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/malloc-as-output.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/malloc-as-output.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Makes an output from allocated block in memory. # Here `allocated` is `malloc.of.allocated` object. 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 51a44c4365..2effd498ea 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/stdin.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/stdin.eo @@ -26,6 +26,9 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # The `stdin` object is a convenient wrapper on `console` object # which is used as input only and allows to read the data from console. 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 3412bf9576..d805292769 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/stdout.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/stdout.eo @@ -25,6 +25,9 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # The `stdout` object is convenient wrapper on `console` object which # uses it as output only and allows to print given argument to console as `string`: diff --git a/eo-runtime/src/main/eo/org/eolang/io/tee-input.eo b/eo-runtime/src/main/eo/org/eolang/io/tee-input.eo index 7b0d836e17..48663dfc7a 100644 --- a/eo-runtime/src/main/eo/org/eolang/io/tee-input.eo +++ b/eo-runtime/src/main/eo/org/eolang/io/tee-input.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.io +version 0.0.0 ++unlint object-has-data # Tee input is an input that reads from provided `input`, # writes to provided `output` and behaves as provided `input`. diff --git a/eo-runtime/src/main/eo/org/eolang/malloc.eo b/eo-runtime/src/main/eo/org/eolang/malloc.eo index 8e566a98fa..153aeb7d9a 100644 --- a/eo-runtime/src/main/eo/org/eolang/malloc.eo +++ b/eo-runtime/src/main/eo/org/eolang/malloc.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data +unlint broken-ref # The `malloc` object is an abstraction of a storage of data in heap diff --git a/eo-runtime/src/main/eo/org/eolang/math/angle.eo b/eo-runtime/src/main/eo/org/eolang/math/angle.eo index 533705e4ae..14c88c583d 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/angle.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/angle.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The angle. # A measure of how much something is tilted or rotated, measured in degrees or radians. diff --git a/eo-runtime/src/main/eo/org/eolang/math/e.eo b/eo-runtime/src/main/eo/org/eolang/math/e.eo index 3e547e9869..52243ebe4a 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/e.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/e.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.math +version 0.0.0 ++unlint object-has-data # The Euler's number. # A fundamental mathematical constant approximately equal to 2.7182818284590452354. diff --git a/eo-runtime/src/main/eo/org/eolang/math/integral.eo b/eo-runtime/src/main/eo/org/eolang/math/integral.eo index 4b7e5a7abb..cc5bd5b669 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/integral.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/integral.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.math +version 0.0.0 ++unlint object-has-data +unlint broken-ref # Counts integral from `a` to `b`. diff --git a/eo-runtime/src/main/eo/org/eolang/math/numbers.eo b/eo-runtime/src/main/eo/org/eolang/math/numbers.eo index 30209b6d38..b90b06a23b 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/numbers.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/numbers.eo @@ -25,6 +25,8 @@ +home https://github.com/objectionary/eo +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Sequence of numbers. # Here `sequence` must be a `tuple` or any `tuple` decorator of `number` objects. diff --git a/eo-runtime/src/main/eo/org/eolang/math/pi.eo b/eo-runtime/src/main/eo/org/eolang/math/pi.eo index 85d14b6e3c..880acb9719 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/pi.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/pi.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.math +version 0.0.0 ++unlint object-has-data # Returns an approximate PI number. 3.14159265358979323846 > pi diff --git a/eo-runtime/src/main/eo/org/eolang/math/random.eo b/eo-runtime/src/main/eo/org/eolang/math/random.eo index d306029d73..5b89c275c5 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/random.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/random.eo @@ -27,6 +27,9 @@ +home https://github.com/objectionary/eo +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # Generates a pseudo-random number. [seed] > random diff --git a/eo-runtime/src/main/eo/org/eolang/math/real.eo b/eo-runtime/src/main/eo/org/eolang/math/real.eo index 46ae0a5cc4..7ec3fe1b82 100644 --- a/eo-runtime/src/main/eo/org/eolang/math/real.eo +++ b/eo-runtime/src/main/eo/org/eolang/math/real.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Returns a floating point number. [num] > real diff --git a/eo-runtime/src/main/eo/org/eolang/nan.eo b/eo-runtime/src/main/eo/org/eolang/nan.eo index cfb9ba7b5a..a4faac6fa3 100644 --- a/eo-runtime/src/main/eo/org/eolang/nan.eo +++ b/eo-runtime/src/main/eo/org/eolang/nan.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The `not a number` object is an abstraction # for representing undefined or unrepresentable numerical results. 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 0ea5d01dcc..023c057437 100644 --- a/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/negative-infinity.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # Negative infinity. # A special floating-point value representing an unbounded quantity less than all real numbers. diff --git a/eo-runtime/src/main/eo/org/eolang/net/socket.eo b/eo-runtime/src/main/eo/org/eolang/net/socket.eo index 1809240ca2..e747c8084b 100644 --- a/eo-runtime/src/main/eo/org/eolang/net/socket.eo +++ b/eo-runtime/src/main/eo/org/eolang/net/socket.eo @@ -28,7 +28,10 @@ +home https://github.com/objectionary/eo +package org.eolang.net +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second ++unlint unused-alias # Socket. # diff --git a/eo-runtime/src/main/eo/org/eolang/number.eo b/eo-runtime/src/main/eo/org/eolang/number.eo index 43d8b38578..fb943d62e1 100644 --- a/eo-runtime/src/main/eo/org/eolang/number.eo +++ b/eo-runtime/src/main/eo/org/eolang/number.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # The `number` object is an abstraction of a 64-bit floating-point # number that internally is a chain of eight bytes. 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 b28f61e19b..8aae77ae3c 100644 --- a/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo +++ b/eo-runtime/src/main/eo/org/eolang/positive-infinity.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # Positive infinity. # A special floating-point value representing an unbounded quantity greater than all real numbers. diff --git a/eo-runtime/src/main/eo/org/eolang/seq.eo b/eo-runtime/src/main/eo/org/eolang/seq.eo index e28fdf7183..4d1a58090b 100644 --- a/eo-runtime/src/main/eo/org/eolang/seq.eo +++ b/eo-runtime/src/main/eo/org/eolang/seq.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # Sequence. # The object, when being dataized, dataizes all provided diff --git a/eo-runtime/src/main/eo/org/eolang/string.eo b/eo-runtime/src/main/eo/org/eolang/string.eo index c10ad1df3c..9ab1e7c3a7 100644 --- a/eo-runtime/src/main/eo/org/eolang/string.eo +++ b/eo-runtime/src/main/eo/org/eolang/string.eo @@ -25,6 +25,8 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # The `string` object is an abstraction of a text string, which # internally is a chain of bytes. diff --git a/eo-runtime/src/main/eo/org/eolang/structs/bytes-as-array.eo b/eo-runtime/src/main/eo/org/eolang/structs/bytes-as-array.eo index 0eb118dc62..b3235394f7 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/bytes-as-array.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/bytes-as-array.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data # Represents sequence of bytes as array. # Here `bts` is `bytes` objects, the return value is `tuple` where diff --git a/eo-runtime/src/main/eo/org/eolang/structs/hash-code-of.eo b/eo-runtime/src/main/eo/org/eolang/structs/hash-code-of.eo index e438f7ea4b..5ea6837897 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/hash-code-of.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/hash-code-of.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data # Hash code - the pseudo-unique float numeric # representation of an object. diff --git a/eo-runtime/src/main/eo/org/eolang/structs/list.eo b/eo-runtime/src/main/eo/org/eolang/structs/list.eo index 7f3b939d7d..bded720b0d 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/list.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/list.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data +unlint broken-ref # List implements based operations on collections like reducing, mapping, filtering, etc. diff --git a/eo-runtime/src/main/eo/org/eolang/structs/map.eo b/eo-runtime/src/main/eo/org/eolang/structs/map.eo index 65ea47f892..d96d1ad14c 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/map.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/map.eo @@ -27,7 +27,9 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second # Hash-map. # Here `pairs` must be a `tuple` of `map.entry` object. diff --git a/eo-runtime/src/main/eo/org/eolang/structs/range-of-ints.eo b/eo-runtime/src/main/eo/org/eolang/structs/range-of-ints.eo index 27f10a3851..c730de5ba3 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/range-of-ints.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/range-of-ints.eo @@ -25,7 +25,9 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second # Range of integers from `start` to `end` (soft border) with step = 1. # Here `start` and `end` must be `int`s. If they're not - an error will diff --git a/eo-runtime/src/main/eo/org/eolang/structs/range.eo b/eo-runtime/src/main/eo/org/eolang/structs/range.eo index 780c56da20..417b1effaa 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/range.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/range.eo @@ -25,6 +25,8 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Range - create a `list` containing a range of elements # Here `start` must be a abstract object that must have an object `next` to get diff --git a/eo-runtime/src/main/eo/org/eolang/structs/set.eo b/eo-runtime/src/main/eo/org/eolang/structs/set.eo index 843646715d..1562fc6a02 100644 --- a/eo-runtime/src/main/eo/org/eolang/structs/set.eo +++ b/eo-runtime/src/main/eo/org/eolang/structs/set.eo @@ -26,6 +26,8 @@ +home https://github.com/objectionary/eo +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Set - is an unordered `list` of unique objects. [lst] > set diff --git a/eo-runtime/src/main/eo/org/eolang/switch.eo b/eo-runtime/src/main/eo/org/eolang/switch.eo index cd6fd7a4bc..481ed15ecd 100644 --- a/eo-runtime/src/main/eo/org/eolang/switch.eo +++ b/eo-runtime/src/main/eo/org/eolang/switch.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The object allows to choose right options according to cases conditions. # Parameter cases is the array of two dimensional array, which diff --git a/eo-runtime/src/main/eo/org/eolang/sys/getenv.eo b/eo-runtime/src/main/eo/org/eolang/sys/getenv.eo index 098d4ae779..ef3aa7a9eb 100644 --- a/eo-runtime/src/main/eo/org/eolang/sys/getenv.eo +++ b/eo-runtime/src/main/eo/org/eolang/sys/getenv.eo @@ -27,6 +27,9 @@ +home https://github.com/objectionary/eo +package org.eolang.sys +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # Get environment variable as `string`. # If return `string` is empty - the variable does not exist. diff --git a/eo-runtime/src/main/eo/org/eolang/sys/line-separator.eo b/eo-runtime/src/main/eo/org/eolang/sys/line-separator.eo index e14fae6650..48b9b7b498 100644 --- a/eo-runtime/src/main/eo/org/eolang/sys/line-separator.eo +++ b/eo-runtime/src/main/eo/org/eolang/sys/line-separator.eo @@ -25,6 +25,9 @@ +home https://github.com/objectionary/eo +package org.eolang.sys +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # Returns the system-dependent line separator string. # On UNIX systems, it returns "\n"; diff --git a/eo-runtime/src/main/eo/org/eolang/sys/os.eo b/eo-runtime/src/main/eo/org/eolang/sys/os.eo index 08301bffdf..eb74f1b584 100644 --- a/eo-runtime/src/main/eo/org/eolang/sys/os.eo +++ b/eo-runtime/src/main/eo/org/eolang/sys/os.eo @@ -27,6 +27,8 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Represents the name of the operating system. [] > os diff --git a/eo-runtime/src/main/eo/org/eolang/sys/posix.eo b/eo-runtime/src/main/eo/org/eolang/sys/posix.eo index cb90faff51..197a892cc9 100644 --- a/eo-runtime/src/main/eo/org/eolang/sys/posix.eo +++ b/eo-runtime/src/main/eo/org/eolang/sys/posix.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # Makes a Unix syscall by name with POSIX interface. # See https://filippo.io/linux-syscall-table/. diff --git a/eo-runtime/src/main/eo/org/eolang/sys/win32.eo b/eo-runtime/src/main/eo/org/eolang/sys/win32.eo index 2adefe1b11..729ff09896 100644 --- a/eo-runtime/src/main/eo/org/eolang/sys/win32.eo +++ b/eo-runtime/src/main/eo/org/eolang/sys/win32.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # Makes a kernel32.dll function call by name. # diff --git a/eo-runtime/src/main/eo/org/eolang/true.eo b/eo-runtime/src/main/eo/org/eolang/true.eo index f220357e65..f0d68a556f 100644 --- a/eo-runtime/src/main/eo/org/eolang/true.eo +++ b/eo-runtime/src/main/eo/org/eolang/true.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The object is a TRUE boolean state. [] > true diff --git a/eo-runtime/src/main/eo/org/eolang/try.eo b/eo-runtime/src/main/eo/org/eolang/try.eo index 5367b0e8b6..5ae0501de8 100644 --- a/eo-runtime/src/main/eo/org/eolang/try.eo +++ b/eo-runtime/src/main/eo/org/eolang/try.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # Try, catch and finally. This object helps catch errors created by the # `error` object. When being dataized, such objects will crash the problem. diff --git a/eo-runtime/src/main/eo/org/eolang/tuple.eo b/eo-runtime/src/main/eo/org/eolang/tuple.eo index a066bceceb..fcecaa7281 100644 --- a/eo-runtime/src/main/eo/org/eolang/tuple.eo +++ b/eo-runtime/src/main/eo/org/eolang/tuple.eo @@ -25,6 +25,7 @@ +package org.eolang +version 0.0.0 +unlint object-has-data ++unlint object-has-data # Tuple. # An ordered, immutable collection of elements. diff --git a/eo-runtime/src/main/eo/org/eolang/txt/regex.eo b/eo-runtime/src/main/eo/org/eolang/txt/regex.eo index 516d3fe1b3..4b8bbd5930 100644 --- a/eo-runtime/src/main/eo/org/eolang/txt/regex.eo +++ b/eo-runtime/src/main/eo/org/eolang/txt/regex.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # Regular expression in Perl format. # Here `pattern` is a string pattern. diff --git a/eo-runtime/src/main/eo/org/eolang/txt/sprintf.eo b/eo-runtime/src/main/eo/org/eolang/txt/sprintf.eo index a1ab1daa6f..b9fd46c7f0 100644 --- a/eo-runtime/src/main/eo/org/eolang/txt/sprintf.eo +++ b/eo-runtime/src/main/eo/org/eolang/txt/sprintf.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # The sprintf object allows you to format and output text depending # on the arguments passed to it. diff --git a/eo-runtime/src/main/eo/org/eolang/txt/sscanf.eo b/eo-runtime/src/main/eo/org/eolang/txt/sscanf.eo index fedff7ad56..d7d81cf71c 100644 --- a/eo-runtime/src/main/eo/org/eolang/txt/sscanf.eo +++ b/eo-runtime/src/main/eo/org/eolang/txt/sscanf.eo @@ -26,6 +26,7 @@ +rt jvm org.eolang:eo-runtime:0.0.0 +rt node eo2js-runtime:0.0.0 +version 0.0.0 ++unlint object-has-data # Reads formatted input from a string. # This object has two free attributes: diff --git a/eo-runtime/src/main/eo/org/eolang/txt/text.eo b/eo-runtime/src/main/eo/org/eolang/txt/text.eo index 1c6d9dc1e5..85a8ac421a 100644 --- a/eo-runtime/src/main/eo/org/eolang/txt/text.eo +++ b/eo-runtime/src/main/eo/org/eolang/txt/text.eo @@ -29,11 +29,14 @@ +home https://github.com/objectionary/eo +package org.eolang.txt +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second ++unlint unused-alias # Text. # A sequence of characters representing words, sentences, or data. -# @todo #3481:30min Remove all +unlit broken-ref from EO source code. +# @todo #3481:30min Remove all +unlit metas from EO source code. # These suppressions were added in order to be compile EO when @ref attribute # from XMIR is removed, by it's checked by LintMojo. We need to remove these # suppressions when `lints` repository is fixed and new version is used in EO. diff --git a/eo-runtime/src/main/eo/org/eolang/while.eo b/eo-runtime/src/main/eo/org/eolang/while.eo index 79f38d3806..9b11175155 100644 --- a/eo-runtime/src/main/eo/org/eolang/while.eo +++ b/eo-runtime/src/main/eo/org/eolang/while.eo @@ -24,6 +24,7 @@ +home https://github.com/objectionary/eo +package org.eolang +version 0.0.0 ++unlint object-has-data # The `while` object is very similar to a loop with a pre-condition. # Here's how you can use it: diff --git a/eo-runtime/src/test/eo/org/eolang/bool-tests.eo b/eo-runtime/src/test/eo/org/eolang/bool-tests.eo index eabdb9ee4b..1cc75df894 100644 --- a/eo-runtime/src/test/eo/org/eolang/bool-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/bool-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > compares-two-bools diff --git a/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo b/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo index c1be0ff709..d80f7c041f 100644 --- a/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/bytes-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > takes-part-of-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/cti-test.eo b/eo-runtime/src/test/eo/org/eolang/cti-test.eo index 35c9645130..0e4e58d7fd 100644 --- a/eo-runtime/src/test/eo/org/eolang/cti-test.eo +++ b/eo-runtime/src/test/eo/org/eolang/cti-test.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > just-prints-warning 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 d252d8a398..d405142c78 100644 --- a/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/dataized-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > dataized-does-not-do-recalculation diff --git a/eo-runtime/src/test/eo/org/eolang/fs/dir-tests.eo b/eo-runtime/src/test/eo/org/eolang/fs/dir-tests.eo index 1d27ff2f3b..2c21d7c883 100644 --- a/eo-runtime/src/test/eo/org/eolang/fs/dir-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/fs/dir-tests.eo @@ -27,6 +27,9 @@ +tests +package org.eolang.fs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > bound-tmpfile-does-not-recreates-file diff --git a/eo-runtime/src/test/eo/org/eolang/fs/file-tests.eo b/eo-runtime/src/test/eo/org/eolang/fs/file-tests.eo index 39668ce60b..060d358c0d 100644 --- a/eo-runtime/src/test/eo/org/eolang/fs/file-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/fs/file-tests.eo @@ -30,7 +30,10 @@ +tests +package org.eolang.fs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > check-if-current-directory-is-directory diff --git a/eo-runtime/src/test/eo/org/eolang/fs/path-tests.eo b/eo-runtime/src/test/eo/org/eolang/fs/path-tests.eo index 1357f11b32..b7c7204989 100644 --- a/eo-runtime/src/test/eo/org/eolang/fs/path-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/fs/path-tests.eo @@ -27,6 +27,9 @@ +tests +package org.eolang.fs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > determines-separator-depending-on-os diff --git a/eo-runtime/src/test/eo/org/eolang/fs/tmpdir-tests.eo b/eo-runtime/src/test/eo/org/eolang/fs/tmpdir-tests.eo index 24f9891b85..3f67345d29 100644 --- a/eo-runtime/src/test/eo/org/eolang/fs/tmpdir-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/fs/tmpdir-tests.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.fs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. tmpdir.exists > [] > global-temp-dir-exists diff --git a/eo-runtime/src/test/eo/org/eolang/go-tests.eo b/eo-runtime/src/test/eo/org/eolang/go-tests.eo index 119dbeb711..72947dea55 100644 --- a/eo-runtime/src/test/eo/org/eolang/go-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/go-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # This unit test is supposed to check the functionality of the corresponding object. diff --git a/eo-runtime/src/test/eo/org/eolang/i16-tests.eo b/eo-runtime/src/test/eo/org/eolang/i16-tests.eo index 2d4b92c918..7880441668 100644 --- a/eo-runtime/src/test/eo/org/eolang/i16-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/i16-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > i16-has-valid-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/i32-tests.eo b/eo-runtime/src/test/eo/org/eolang/i32-tests.eo index 3fcc5b66b9..4f67c712f1 100644 --- a/eo-runtime/src/test/eo/org/eolang/i32-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/i32-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > i32-has-valid-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/i64-tests.eo b/eo-runtime/src/test/eo/org/eolang/i64-tests.eo index eebc370c7f..c057408a7c 100644 --- a/eo-runtime/src/test/eo/org/eolang/i64-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/i64-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > i64-has-valid-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/io/bytes-as-input-test.eo b/eo-runtime/src/test/eo/org/eolang/io/bytes-as-input-test.eo index b5687581f6..e098bdde36 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/bytes-as-input-test.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/bytes-as-input-test.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > makes-an-input-from-bytes-and-reads diff --git a/eo-runtime/src/test/eo/org/eolang/io/console-test.eo b/eo-runtime/src/test/eo/org/eolang/io/console-test.eo index 5f5a3a611a..2306d23cb8 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/console-test.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/console-test.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # Prints a simple message to the console. We can't validate # the output, so we just run it and see if it crashes. diff --git a/eo-runtime/src/test/eo/org/eolang/io/dead-input-tests.eo b/eo-runtime/src/test/eo/org/eolang/io/dead-input-tests.eo index 580ae10171..da2511784a 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/dead-input-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/dead-input-tests.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > reads-empty-bytes diff --git a/eo-runtime/src/test/eo/org/eolang/io/dead-output-tests.eo b/eo-runtime/src/test/eo/org/eolang/io/dead-output-tests.eo index 1abf304e1f..6f099eb86b 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/dead-output-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/dead-output-tests.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. dead-output.write 01-02-03 > [] > writes-bytes-to-nowhere diff --git a/eo-runtime/src/test/eo/org/eolang/io/input-length-tests.eo b/eo-runtime/src/test/eo/org/eolang/io/input-length-tests.eo index bf4979b131..6a2790141e 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/input-length-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/input-length-tests.eo @@ -29,6 +29,8 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > reads-all-bytes-and-returns-length diff --git a/eo-runtime/src/test/eo/org/eolang/io/malloc-as-output-test.eo b/eo-runtime/src/test/eo/org/eolang/io/malloc-as-output-test.eo index ea9fafdfd7..f27a3cf5a1 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/malloc-as-output-test.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/malloc-as-output-test.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > makes-an-output-from-malloc-and-writes diff --git a/eo-runtime/src/test/eo/org/eolang/io/stdout-test.eo b/eo-runtime/src/test/eo/org/eolang/io/stdout-test.eo index 9ddf518a39..868a4b1016 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/stdout-test.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/stdout-test.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # Prints a simple message to the console. We can't validate # the output, so we just run it and see if it crashes. diff --git a/eo-runtime/src/test/eo/org/eolang/io/tee-input-tests.eo b/eo-runtime/src/test/eo/org/eolang/io/tee-input-tests.eo index ca9866307d..039fe0f9b3 100644 --- a/eo-runtime/src/test/eo/org/eolang/io/tee-input-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/io/tee-input-tests.eo @@ -28,7 +28,9 @@ +tests +package org.eolang.io +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > reads-from-bytes-and-writes-to-memory 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 92c0fd2540..08dac84e9a 100644 --- a/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/malloc-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # This unit test is supposed to check the functionality of the corresponding object. diff --git a/eo-runtime/src/test/eo/org/eolang/math/angle-tests.eo b/eo-runtime/src/test/eo/org/eolang/math/angle-tests.eo index 2538392a08..051948dd07 100644 --- a/eo-runtime/src/test/eo/org/eolang/math/angle-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/math/angle-tests.eo @@ -27,6 +27,8 @@ +tests +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > sin-zero diff --git a/eo-runtime/src/test/eo/org/eolang/math/integral-tests.eo b/eo-runtime/src/test/eo/org/eolang/math/integral-tests.eo index 509274f31e..91fab63596 100644 --- a/eo-runtime/src/test/eo/org/eolang/math/integral-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/math/integral-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > calculates-lineal-integral diff --git a/eo-runtime/src/test/eo/org/eolang/math/numbers-tests.eo b/eo-runtime/src/test/eo/org/eolang/math/numbers-tests.eo index d5b5813805..d50ba5b242 100644 --- a/eo-runtime/src/test/eo/org/eolang/math/numbers-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/math/numbers-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. (numbers *).max > [] > throws-on-taking-max-from-empty-sequence-of-numbers diff --git a/eo-runtime/src/test/eo/org/eolang/math/random-tests.eo b/eo-runtime/src/test/eo/org/eolang/math/random-tests.eo index d3751c9a4f..45760db6ef 100644 --- a/eo-runtime/src/test/eo/org/eolang/math/random-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/math/random-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > random-with-seed diff --git a/eo-runtime/src/test/eo/org/eolang/math/real-tests.eo b/eo-runtime/src/test/eo/org/eolang/math/real-tests.eo index 738e7d5878..4ac933e541 100644 --- a/eo-runtime/src/test/eo/org/eolang/math/real-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/math/real-tests.eo @@ -28,6 +28,8 @@ +tests +package org.eolang.math +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > abs-int-positive diff --git a/eo-runtime/src/test/eo/org/eolang/nan-tests.eo b/eo-runtime/src/test/eo/org/eolang/nan-tests.eo index 9085b22321..446ef988a5 100644 --- a/eo-runtime/src/test/eo/org/eolang/nan-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/nan-tests.eo @@ -25,6 +25,7 @@ +package org.eolang +tests +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > nan-not-eq-number diff --git a/eo-runtime/src/test/eo/org/eolang/negative-infinity-tests.eo b/eo-runtime/src/test/eo/org/eolang/negative-infinity-tests.eo index ba448698ca..235521b2d4 100644 --- a/eo-runtime/src/test/eo/org/eolang/negative-infinity-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/negative-infinity-tests.eo @@ -25,6 +25,7 @@ +package org.eolang +tests +version 0.0.0 ++unlint object-has-data # Equal to. [] > negative-infinity-is-equal-to-one-div-zero diff --git a/eo-runtime/src/test/eo/org/eolang/number-tests.eo b/eo-runtime/src/test/eo/org/eolang/number-tests.eo index c1cdda3e18..f73efedffc 100644 --- a/eo-runtime/src/test/eo/org/eolang/number-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/number-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > int-less-true diff --git a/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo b/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo index c484f3d0f0..4fc67e3e8d 100644 --- a/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/positive-infinity-tests.eo @@ -25,6 +25,7 @@ +package org.eolang +tests +version 0.0.0 ++unlint object-has-data # Equal to. [] > positive-infinity-is-equal-to-one-div-zero 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 91c039fcac..5073280b26 100644 --- a/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/runtime-tests.eo @@ -27,6 +27,7 @@ +unlint abstract-decoratee +unlint broken-ref +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the globals bound objects work as tests. true > global-test 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 0708de2145..23c7aa2595 100644 --- a/eo-runtime/src/test/eo/org/eolang/seq-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/seq-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # This unit test is supposed to check the functionality of the corresponding object. 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 1c139d93d5..d818a447e4 100644 --- a/eo-runtime/src/test/eo/org/eolang/string-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/string-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > calculates-length-of-spaces-only diff --git a/eo-runtime/src/test/eo/org/eolang/structs/bytes-as-array-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/bytes-as-array-tests.eo index bf14583a5b..0a4fa06275 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/bytes-as-array-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/bytes-as-array-tests.eo @@ -27,6 +27,8 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > converts-bytes-to-array diff --git a/eo-runtime/src/test/eo/org/eolang/structs/hash-code-of-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/hash-code-of-tests.eo index 8a413b57ae..ef88deeb47 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/hash-code-of-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/hash-code-of-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > hash-code-of-bools-is-number diff --git a/eo-runtime/src/test/eo/org/eolang/structs/list-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/list-tests.eo index 47922e0aad..f51941a6f5 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/list-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/list-tests.eo @@ -27,7 +27,9 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data +unlint broken-ref ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > list-should-not-be-empty diff --git a/eo-runtime/src/test/eo/org/eolang/structs/map-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/map-tests.eo index 8d4edb0878..3d544d0ef4 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/map-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/map-tests.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > map-rebuilds-itself diff --git a/eo-runtime/src/test/eo/org/eolang/structs/range-of-ints-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/range-of-ints-tests.eo index fd3cc1bb80..b849b7d68d 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/range-of-ints-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/range-of-ints-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > simple-range-of-ints-from-one-to-ten diff --git a/eo-runtime/src/test/eo/org/eolang/structs/range-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/range-tests.eo index ab2b5c69b9..c149968673 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/range-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/range-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > simple-range-from-one-to-ten diff --git a/eo-runtime/src/test/eo/org/eolang/structs/set-tests.eo b/eo-runtime/src/test/eo/org/eolang/structs/set-tests.eo index ede16131e0..2ccca15c52 100644 --- a/eo-runtime/src/test/eo/org/eolang/structs/set-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/structs/set-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.structs +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > set-rebuilds-itself 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 b6464135c0..b636eb7df0 100644 --- a/eo-runtime/src/test/eo/org/eolang/switch-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/switch-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # This unit test is supposed to check the functionality of the corresponding object. diff --git a/eo-runtime/src/test/eo/org/eolang/sys/os-tests.eo b/eo-runtime/src/test/eo/org/eolang/sys/os-tests.eo index d639237797..086315bac8 100644 --- a/eo-runtime/src/test/eo/org/eolang/sys/os-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/sys/os-tests.eo @@ -26,6 +26,9 @@ +tests +package org.eolang.sys +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > checks-os-family diff --git a/eo-runtime/src/test/eo/org/eolang/sys/posix-tests.eo b/eo-runtime/src/test/eo/org/eolang/sys/posix-tests.eo index feb4d96269..4ab551567e 100644 --- a/eo-runtime/src/test/eo/org/eolang/sys/posix-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/sys/posix-tests.eo @@ -27,6 +27,9 @@ +tests +package org.eolang.sys +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > invokes-getpid-correctly diff --git a/eo-runtime/src/test/eo/org/eolang/sys/win32-tests.eo b/eo-runtime/src/test/eo/org/eolang/sys/win32-tests.eo index 66d646f17c..e56ce57f64 100644 --- a/eo-runtime/src/test/eo/org/eolang/sys/win32-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/sys/win32-tests.eo @@ -27,6 +27,9 @@ +tests +package org.eolang.sys +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > returns-valid-win32-inet-addr-for-localhost 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 290eac05c4..2c45ddfa73 100644 --- a/eo-runtime/src/test/eo/org/eolang/try-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/try-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > catches-simple-exception 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 23f11ebb9f..e2aea6f7d0 100644 --- a/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/tuple-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data # This unit test is supposed to check the functionality of the corresponding object. [] > makes-tuple-through-special-syntax diff --git a/eo-runtime/src/test/eo/org/eolang/txt/regex-tests.eo b/eo-runtime/src/test/eo/org/eolang/txt/regex-tests.eo index 62c12f9c4f..f6aec2b621 100644 --- a/eo-runtime/src/test/eo/org/eolang/txt/regex-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/txt/regex-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.txt +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > matches-regex-against-the-pattern diff --git a/eo-runtime/src/test/eo/org/eolang/txt/sprintf-tests.eo b/eo-runtime/src/test/eo/org/eolang/txt/sprintf-tests.eo index 709db16f26..ab5faeb4ea 100644 --- a/eo-runtime/src/test/eo/org/eolang/txt/sprintf-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/txt/sprintf-tests.eo @@ -26,6 +26,8 @@ +tests +package org.eolang.txt +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > prints-simple-string diff --git a/eo-runtime/src/test/eo/org/eolang/txt/sscanf-tests.eo b/eo-runtime/src/test/eo/org/eolang/txt/sscanf-tests.eo index 0fd3c2cb3b..0a30c8e86e 100644 --- a/eo-runtime/src/test/eo/org/eolang/txt/sscanf-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/txt/sscanf-tests.eo @@ -28,6 +28,9 @@ +tests +package org.eolang.txt +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second ++unlint unused-alias # This unit test is supposed to check the functionality of the corresponding object. [] > sscanf-with-string diff --git a/eo-runtime/src/test/eo/org/eolang/txt/text-tests.eo b/eo-runtime/src/test/eo/org/eolang/txt/text-tests.eo index 58f47e59c6..bd5cb7d9b6 100644 --- a/eo-runtime/src/test/eo/org/eolang/txt/text-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/txt/text-tests.eo @@ -28,6 +28,8 @@ +tests +package org.eolang.txt +version 0.0.0 ++unlint object-has-data ++unlint broken-alias-second # This unit test is supposed to check the functionality of the corresponding object. [] > text-slices-the-origin-string 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 85c84f7e01..ce3f021f6b 100644 --- a/eo-runtime/src/test/eo/org/eolang/while-tests.eo +++ b/eo-runtime/src/test/eo/org/eolang/while-tests.eo @@ -25,6 +25,7 @@ +tests +package org.eolang +version 0.0.0 ++unlint object-has-data +unlint broken-ref # This unit test is supposed to check the functionality of the corresponding object. diff --git a/eo-runtime/src/test/resources/org/eolang/snippets/fibo.yaml b/eo-runtime/src/test/resources/org/eolang/snippets/fibo.yaml index fa5a86dc02..195f848425 100644 --- a/eo-runtime/src/test/resources/org/eolang/snippets/fibo.yaml +++ b/eo-runtime/src/test/resources/org/eolang/snippets/fibo.yaml @@ -28,6 +28,8 @@ eo: | +alias org.eolang.io.stdout +alias org.eolang.txt.sprintf +package org.eolang.snippets + +unlint object-has-data + +unlint broken-alias-second # No comments. [args] > fibo From 41aabd72e71f9c21249dfe638661ac9cb584a680 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Wed, 29 Jan 2025 21:29:39 +0300 Subject: [PATCH 12/12] bug(#3845): remove DiscoverMojo --- .../java/org/eolang/maven/DiscoverMojo.java | 137 ------------------ .../org/eolang/maven/tojos/ForeignTojo.java | 10 -- .../org/eolang/maven/tojos/ForeignTojos.java | 18 --- .../org/eolang/maven/DiscoverMojoTest.java | 101 ------------- .../test/java/org/eolang/maven/FakeMaven.java | 17 --- .../org/eolang/maven/ResolveMojoTest.java | 2 +- 6 files changed, 1 insertion(+), 284 deletions(-) delete mode 100644 eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java delete mode 100644 eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java deleted file mode 100644 index 62b436d44b..0000000000 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/DiscoverMojo.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2016-2025 Objectionary.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package org.eolang.maven; - -import com.jcabi.log.Logger; -import com.jcabi.xml.SaxonDocument; -import com.jcabi.xml.XML; -import java.nio.file.Path; -import java.util.Collection; -import java.util.HashSet; -import org.apache.maven.plugins.annotations.LifecyclePhase; -import org.apache.maven.plugins.annotations.Mojo; -import org.cactoos.iterable.Filtered; -import org.cactoos.set.SetOf; -import org.eolang.maven.tojos.ForeignTojo; - -/** - * Read all XMIR files and find foreign objects in them, then - * add them to the catalog. - * - * @since 0.1 - */ -@Mojo( - name = "discover-foreign", - defaultPhase = LifecyclePhase.PROCESS_SOURCES, - threadSafe = true -) -public final class DiscoverMojo extends SafeMojo { - /** - * Xpath for discovering. - */ - private static final String XPATH = String.join( - "", - "//o[", - "not(starts-with(@base, '.'))", - " and @base != 'Q'", - " and @base != '^'", - " and @base != '$'", - " and @base != '∅'", - "]/@base" - ); - - @Override - public void exec() { - final Collection tojos = this.scopedTojos().notDiscovered(); - final Collection discovered = new HashSet<>(); - for (final ForeignTojo tojo : tojos) { - final Path src = tojo.shaken(); - final Collection names = this.discover(src); - discovered.addAll(names); - for (final String name : names) { - this.scopedTojos().add(name).withDiscoveredAt(src); - } - tojo.withDiscovered(discovered.size()); - } - if (tojos.isEmpty()) { - if (this.scopedTojos().size() == 0) { - Logger.warn(this, "Nothing to discover, since there are no programs"); - } else { - Logger.info( - this, - "Nothing to discover, all %d programs checked already", - this.scopedTojos().size() - ); - } - } else if (discovered.isEmpty()) { - Logger.info( - this, "No foreign objects discovered in %d programs", - tojos.size() - ); - } else { - Logger.info( - this, "Discovered %d foreign objects in %d programs: %s", - discovered.size(), tojos.size(), discovered - ); - } - } - - /** - * Pull all deps found in the provided XML file. - * - * @param file The .xmir file - * @return List of foreign objects found - */ - private Collection discover(final Path file) { - final XML xml = new SaxonDocument(file); - final Collection names = DiscoverMojo.names(xml); - if (names.isEmpty()) { - Logger.debug( - this, "Didn't find any foreign objects in %[file]s", - file - ); - } else { - Logger.debug( - this, "Found %d foreign objects in %[file]s: %s", - names.size(), file, names - ); - } - return names; - } - - /** - * Get a unique list of object names from given XML. - * - * @param xml XML. - * @return Object names. - */ - private static Collection names(final XML xml) { - return new SetOf<>( - new Filtered<>( - name -> !name.isEmpty(), - xml.xpath(DiscoverMojo.XPATH) - ) - ); - } -} diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java index fb83a78ba5..52eb8b0f55 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojo.java @@ -196,16 +196,6 @@ public ForeignTojo withJar(final Coordinates coordinates) { return this; } - /** - * Set the discovered size. - * @param size The size. - * @return The tojo itself. - */ - public ForeignTojo withDiscovered(final int size) { - this.delegate.set(ForeignTojos.Attribute.DISCOVERED.getKey(), Integer.valueOf(size)); - return this; - } - /** * Set the discovered at. * @param path The path where was discovered. diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojos.java b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojos.java index bb29c02c85..c6fcca0d92 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojos.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/tojos/ForeignTojos.java @@ -133,18 +133,6 @@ public ForeignTojo find(final String id) { ); } - /** - * Get the tojos that are not discovered yet. - * @return The tojos. - */ - public Collection notDiscovered() { - return this.select( - row -> - row.exists(Attribute.SHAKEN.getKey()) - && !row.exists(Attribute.DISCOVERED.getKey()) - ); - } - /** * Get the tojos that have corresponding xmir. * @return The tojos. @@ -245,7 +233,6 @@ public String status() { Attribute.EO, Attribute.XMIR, Attribute.SHAKEN, - Attribute.DISCOVERED, Attribute.PROBED, }; final Collection parts = new LinkedList<>(); @@ -320,11 +307,6 @@ enum Attribute { */ JAR("jar"), - /** - * In how many EO programs this object was seen (integer). - */ - DISCOVERED("discovered"), - /** * Absolute path of the {@code .xmir} file where this object was discovered. */ diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java deleted file mode 100644 index 069454e367..0000000000 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/DiscoverMojoTest.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2016-2025 Objectionary.com - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ -package org.eolang.maven; - -import com.yegor256.Mktmp; -import com.yegor256.MktmpResolver; -import com.yegor256.tojos.MnCsv; -import java.io.IOException; -import java.nio.file.Path; -import java.util.Deque; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import org.cactoos.io.ResourceOf; -import org.eolang.maven.tojos.ForeignTojo; -import org.hamcrest.MatcherAssert; -import org.hamcrest.Matchers; -import org.junit.jupiter.api.Disabled; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; - -/** - * Test case for {@link DiscoverMojo}. - * - * @since 0.28.11 - */ -@ExtendWith(MktmpResolver.class) -@Disabled -final class DiscoverMojoTest { - @ParameterizedTest - @CsvSource({ - "org/eolang/maven/mess.eo, 7", - "org/eolang/maven/sum.eo, 0", - "org/eolang/maven/withwarning.eo, 1" - }) - void executesDiscoveryPhaseForCorrectEoPrograms( - final String program, - final int dependencies, - @Mktmp final Path tmp - ) throws IOException { - final FakeMaven maven = new FakeMaven(tmp); - maven.withProgram(new ResourceOf(program)) - .execute(new FakeMaven.Discover()); - final Deque> json = new LinkedList<>( - new MnCsv(maven.foreignPath()).read() - ); - final Map first = json.removeFirst(); - MatcherAssert.assertThat( - CatalogsTest.TO_ADD_MESSAGE, - dependencies, - Matchers.equalTo(json.size()) - ); - MatcherAssert.assertThat( - CatalogsTest.TO_ADD_MESSAGE, - String.valueOf(dependencies), - Matchers.equalTo(first.get("discovered")) - ); - } - - @Test - void discoversForDifferentScopes(@Mktmp final Path tmp) throws IOException { - final FakeMaven maven = new FakeMaven(tmp); - final String scope = "test"; - maven.with("scope", scope) - .withHelloWorld() - .execute(new FakeMaven.Discover()); - final List scopes = maven.foreignTojos().all() - .stream() - .map(ForeignTojo::scope) - .collect(Collectors.toList()); - MatcherAssert.assertThat( - String.format("All tojos have the same scope '%s', but was '%s'", scope, scopes), - scopes.stream().allMatch(s -> s.equals(scope)), - Matchers.is(true) - ); - } -} diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java index 5e06c53928..c4a27b8568 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/FakeMaven.java @@ -735,23 +735,6 @@ public Iterator> iterator() { } } - /** - * Discovery pipeline. - * - * @since 0.31 - */ - static final class Discover implements Iterable> { - - @Override - public Iterator> iterator() { - return Arrays.>asList( - ParseMojo.class, - ShakeMojo.class, - DiscoverMojo.class - ).iterator(); - } - } - /** * Printing pipeline. * diff --git a/eo-maven-plugin/src/test/java/org/eolang/maven/ResolveMojoTest.java b/eo-maven-plugin/src/test/java/org/eolang/maven/ResolveMojoTest.java index cfa3dcba3e..0b7a077ded 100644 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/ResolveMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/ResolveMojoTest.java @@ -118,7 +118,7 @@ void resolvesWithoutAnyDependencies(@Mktmp final Path temp) throws IOException { " a", " b" ); - maven.foreignTojos().add("sum").withDiscovered(0); + maven.foreignTojos().add("sum"); maven.execute(new FakeMaven.Resolve()); final Path path = temp .resolve("target")