From e5ab1a3774e4a0491440856ffea937ba66e0ac69 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Thu, 15 Feb 2024 15:20:53 +0300 Subject: [PATCH 1/3] #2873: straight instead of strait --- .../src/test/java/org/eolang/maven/PrintMojoTest.java | 6 +++--- .../resources/org/eolang/maven/print/samples/bytes.yaml | 4 ++-- .../org/eolang/maven/print/samples/dataless.yaml | 2 +- .../org/eolang/maven/print/samples/empty-bytes.yaml | 2 +- .../org/eolang/maven/print/samples/empty-string.yaml | 2 +- .../org/eolang/maven/print/samples/idiomatic.yaml | 2 +- .../org/eolang/maven/print/samples/inheritance.yaml | 8 ++++---- .../org/eolang/maven/print/samples/just-float.yaml | 2 +- .../org/eolang/maven/print/samples/multiline-string.yaml | 2 +- .../org/eolang/maven/print/samples/stars-tuples.yaml | 2 +- .../resources/org/eolang/maven/print/samples/times.yaml | 2 +- eo-parser/src/main/java/org/eolang/parser/xmir/Xmir.java | 2 +- .../src/main/resources/org/eolang/parser/xmir-to-eo.xsl | 2 +- .../src/test/java/org/eolang/parser/xmir/XmirTest.java | 4 ++-- .../test/resources/org/eolang/parser/samples/bytes.yaml | 4 ++-- .../resources/org/eolang/parser/samples/dataless.yaml | 2 +- .../resources/org/eolang/parser/samples/empty-bytes.yaml | 2 +- .../resources/org/eolang/parser/samples/empty-string.yaml | 2 +- .../resources/org/eolang/parser/samples/idiomatic.yaml | 2 +- .../resources/org/eolang/parser/samples/inheritance.yaml | 8 ++++---- .../resources/org/eolang/parser/samples/just-float.yaml | 2 +- .../org/eolang/parser/samples/multiline-string.yaml | 2 +- .../resources/org/eolang/parser/samples/stars-tuples.yaml | 2 +- .../test/resources/org/eolang/parser/samples/times.yaml | 2 +- 24 files changed, 35 insertions(+), 35 deletions(-) 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 fe203ee3b6..19675809cf 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 @@ -81,12 +81,12 @@ void printsSuccessfully(@TempDir final Path temp) throws Exception { @ParameterizedTest @ClasspathSource(value = "org/eolang/maven/print/samples/", glob = "**.yaml") - void printsInStraitNotation(final String pack, @TempDir final Path temp) throws Exception { + void printsInStraightNotation(final String pack, @TempDir final Path temp) throws Exception { final Map yaml = new Yaml().load(pack); MatcherAssert.assertThat( - "PrintMojo should print EO in strait notation, but it didn't", + "PrintMojo should print EO in straight notation, but it didn't", PrintMojoTest.printed(yaml, temp, false).asString(), - Matchers.equalTo((String) yaml.get("strait")) + Matchers.equalTo((String) yaml.get("straight")) ); } diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/bytes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/bytes.yaml index f027bdb0c2..ae2963e4de 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/bytes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/bytes.yaml @@ -1,13 +1,13 @@ origin: | EA-EA-EA-EA > xs - + "hello" > ys TRUE > b1 FALSE > b2 -strait: | +straight: | EA-EA-EA-EA > xs "hello" > ys diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/dataless.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/dataless.yaml index f8babe9ad5..9c167eb11a 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/dataless.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/dataless.yaml @@ -11,7 +11,7 @@ origin: | input-of args.at not-a-number -strait: | +straight: | +package sandbox # This is the default 64+ symbols comment in front of named abstract object. diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-bytes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-bytes.yaml index b65828c795..2a6decade7 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-bytes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-bytes.yaml @@ -1,7 +1,7 @@ origin: | -- > empty -strait: | +straight: | -- > empty reversed: | diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-string.yaml index 1ad2e9aeb3..03e2fba92f 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/empty-string.yaml @@ -4,7 +4,7 @@ origin: | QQ.io.stdout > @ QQ.txt.sprintf "" -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/idiomatic.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/idiomatic.yaml index 339950cbf0..7c27d4ee07 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/idiomatic.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/idiomatic.yaml @@ -29,7 +29,7 @@ origin: | n "hello, 大家!" -strait: | +straight: | # This is the license part # of the program diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/inheritance.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/inheritance.yaml index 4c8b02e88c..e5102a8be6 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/inheritance.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/inheritance.yaml @@ -3,7 +3,7 @@ origin: | +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory 0 > x @@ -26,12 +26,12 @@ origin: | self v -strait: | +straight: | +package sandbox +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory > x @@ -63,7 +63,7 @@ reversed: | +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory > x diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/just-float.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/just-float.yaml index d5aed43623..f6171ca491 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/just-float.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/just-float.yaml @@ -4,7 +4,7 @@ origin: | [] > foo 2.18 > e -strait: | +straight: | 3.14 > pi # This is the default 64+ symbols comment in front of named abstract object. diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/multiline-string.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/multiline-string.yaml index 7f360bd140..3018c95b9c 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/multiline-string.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/multiline-string.yaml @@ -7,7 +7,7 @@ origin: | it's me """ -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/stars-tuples.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/stars-tuples.yaml index 3b1e60a8d5..02c9616a74 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/stars-tuples.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/stars-tuples.yaml @@ -1,7 +1,7 @@ origin: | * 1 "Hello" x > array -strait: | +straight: | * > array 1 "Hello" diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/times.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/times.yaml index 1a6b1e1472..330a6dbbd0 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/times.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/print/samples/times.yaml @@ -6,7 +6,7 @@ origin: | "result is %d\n" -1.times 228 -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ diff --git a/eo-parser/src/main/java/org/eolang/parser/xmir/Xmir.java b/eo-parser/src/main/java/org/eolang/parser/xmir/Xmir.java index d14992632c..3218effc47 100644 --- a/eo-parser/src/main/java/org/eolang/parser/xmir/Xmir.java +++ b/eo-parser/src/main/java/org/eolang/parser/xmir/Xmir.java @@ -43,7 +43,7 @@ public interface Xmir { String toEO(); /** - * Default Xmir that prints EO with strait vertical methods. + * Default Xmir that prints EO with straight vertical methods. * * This class will help you turn XMIR (XML document) into EOLANG * plain text source code. It's as simple as this: diff --git a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl index 0d1ab4697c..aaaf07756d 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl @@ -24,7 +24,7 @@ SOFTWARE. --> diff --git a/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java b/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java index 5f0d2af0a0..d4cf9b580a 100644 --- a/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java @@ -46,9 +46,9 @@ final class XmirTest { @ParameterizedTest @ClasspathSource(value = "org/eolang/parser/samples/", glob = "**.yaml") - void printsStrait(final String pack) throws IOException { + void printsStraight(final String pack) throws IOException { final Map map = new Yaml().load(pack); - final String key = "strait"; + final String key = "straight"; final String eolang = this.eolang((String) map.get("origin"), Xmir.Default::new); MatcherAssert.assertThat( "Result EO should be parsed without errors", diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/bytes.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/bytes.yaml index f027bdb0c2..ae2963e4de 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/bytes.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/bytes.yaml @@ -1,13 +1,13 @@ origin: | EA-EA-EA-EA > xs - + "hello" > ys TRUE > b1 FALSE > b2 -strait: | +straight: | EA-EA-EA-EA > xs "hello" > ys diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/dataless.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/dataless.yaml index f8babe9ad5..9c167eb11a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/dataless.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/dataless.yaml @@ -11,7 +11,7 @@ origin: | input-of args.at not-a-number -strait: | +straight: | +package sandbox # This is the default 64+ symbols comment in front of named abstract object. diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/empty-bytes.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/empty-bytes.yaml index b65828c795..2a6decade7 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/empty-bytes.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/empty-bytes.yaml @@ -1,7 +1,7 @@ origin: | -- > empty -strait: | +straight: | -- > empty reversed: | diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/empty-string.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/empty-string.yaml index 1ad2e9aeb3..03e2fba92f 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/empty-string.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/empty-string.yaml @@ -4,7 +4,7 @@ origin: | QQ.io.stdout > @ QQ.txt.sprintf "" -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/idiomatic.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/idiomatic.yaml index 339950cbf0..7c27d4ee07 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/idiomatic.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/idiomatic.yaml @@ -29,7 +29,7 @@ origin: | n "hello, 大家!" -strait: | +straight: | # This is the license part # of the program diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/inheritance.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/inheritance.yaml index 4c8b02e88c..e5102a8be6 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/inheritance.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/inheritance.yaml @@ -3,7 +3,7 @@ origin: | +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory 0 > x @@ -26,12 +26,12 @@ origin: | self v -strait: | +straight: | +package sandbox +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory > x @@ -63,7 +63,7 @@ reversed: | +alias stdout org.eolang.io.stdout +alias sprintf org.eolang.txt.sprintf +architect yegor256@gmail.com - + # This is the default 64+ symbols comment in front of named abstract object. [] > base memory > x diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/just-float.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/just-float.yaml index d5aed43623..f6171ca491 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/just-float.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/just-float.yaml @@ -4,7 +4,7 @@ origin: | [] > foo 2.18 > e -strait: | +straight: | 3.14 > pi # This is the default 64+ symbols comment in front of named abstract object. diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/multiline-string.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/multiline-string.yaml index 7f360bd140..3018c95b9c 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/multiline-string.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/multiline-string.yaml @@ -7,7 +7,7 @@ origin: | it's me """ -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/stars-tuples.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/stars-tuples.yaml index 3b1e60a8d5..02c9616a74 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/stars-tuples.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/stars-tuples.yaml @@ -1,7 +1,7 @@ origin: | * 1 "Hello" x > array -strait: | +straight: | * > array 1 "Hello" diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/times.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/times.yaml index 1a6b1e1472..330a6dbbd0 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/samples/times.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/times.yaml @@ -6,7 +6,7 @@ origin: | "result is %d\n" -1.times 228 -strait: | +straight: | # This is the default 64+ symbols comment in front of named abstract object. [] > app QQ From f279f7c50a03161619ab82804c2f2735b27c7653 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Thu, 15 Feb 2024 15:24:34 +0300 Subject: [PATCH 2/3] #2873 reproduced --- .../parser/samples/inner-formation.yaml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/samples/inner-formation.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/inner-formation.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/inner-formation.yaml new file mode 100644 index 0000000000..2760b5b674 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/inner-formation.yaml @@ -0,0 +1,20 @@ +origin: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > foo + test + [] + "hello, world!" > @ + +straight: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > foo + test + [] + "hello, world!" > @ + +reversed: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > foo + test + [] + "hello, world!" > @ From 40ca4abc470f1714b5ba54b9465a92fff6e21442 Mon Sep 17 00:00:00 2001 From: Yegor Bugayenko Date: Thu, 15 Feb 2024 15:27:09 +0300 Subject: [PATCH 3/3] #2873: fixed --- .../resources/org/eolang/parser/xmir-to-eo-reversed.xsl | 6 ++++-- .../src/main/resources/org/eolang/parser/xmir-to-eo.xsl | 6 ++++-- .../src/test/java/org/eolang/parser/xmir/XmirTest.java | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl index 3ba0de2c2f..e99b8bbca4 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo-reversed.xsl @@ -108,8 +108,10 @@ SOFTWARE. - - + + + + [ diff --git a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl index aaaf07756d..a460c30952 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/xmir-to-eo.xsl @@ -124,8 +124,10 @@ SOFTWARE. - - + + + + [ diff --git a/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java b/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java index d4cf9b580a..d8956537b8 100644 --- a/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/xmir/XmirTest.java @@ -103,9 +103,9 @@ private String eolang( first, Matchers.not(XhtmlMatchers.hasXPath("//errors/error")) ); - Logger.debug(this, "First:%n%s", first); + Logger.info(this, "First:%n%s", first); final String eolang = xmir.apply(first).toEO(); - Logger.debug(this, "EOLANG:%n%s", eolang); + Logger.info(this, "EOLANG:%n%s", eolang); return eolang; } }