diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java index 9cc14f45f8..e6af293cca 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/TranspileMojo.java @@ -160,7 +160,7 @@ public final class TranspileMojo extends SafeMojo { @Override public void exec() { - final Collection sources = this.scopedTojos().withOptimized(); + final Collection sources = this.scopedTojos().withShaken(); final Optimization optimization = this.transpilation(); final int saved = new Threaded<>( sources, @@ -197,7 +197,7 @@ private int transpiled(final ForeignTojo tojo, final Optimization transpilation) throws IOException { final Path source; try { - source = tojo.optimized(); + source = tojo.shaken(); } catch (final AttributeNotFoundException exception) { throw new IllegalStateException( "You should check that 'Verify' goal of the plugin was run first", 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 81f8210054..1d1322e2fe 100755 --- a/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java +++ b/eo-maven-plugin/src/test/java/org/eolang/maven/TranspileMojoTest.java @@ -208,7 +208,7 @@ void transpilesSeveralEoProgramsInParallel(@Mktmp final Path temp) throws IOExce .resolve("EOeolang") .resolve("EOexamples") ).count(), - Matchers.equalTo(2L) + Matchers.equalTo(4L) ); } 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 72e44b2a61..76a942423f 100644 --- a/eo-parser/src/main/java/org/eolang/parser/DrProgram.java +++ b/eo-parser/src/main/java/org/eolang/parser/DrProgram.java @@ -64,16 +64,19 @@ public Iterator iterator() { "\n ", "", "This is XMIR, a dialect of XML, which is used to represent a parsed", - "EO program. For more information about the XMIR format, please visit", + "EO program. For more information about XMIR format please visit:", "https://news.eolang.org/2022-11-25-xmir-guide.html.", "", String.format( - "The file was auto-generated by the parser %s (%s) at %s.", + "The file was auto-generated by the parser %s (%s)", Manifests.read("EO-Version"), - Manifests.read("EO-Revision"), + Manifests.read("EO-Revision") + ), + String.format( + "at %s. Do not edit it manually.", when ), - "Do not edit it manually. The source code of the parser is available", + "The source code of the parser is available", "on GitHub, at https://github.com/objectionary/eo (bug reports are welcome).", "" ) @@ -112,6 +115,7 @@ private static String schema() { final String[] opts = { "XMIR.xsd", "src/main/resources/XMIR.xsd", + "eo-parser/src/main/resources/XMIR.xsd", "../eo-parser/src/main/resources/XMIR.xsd", }; for (final String opt : opts) { diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/optimize/float-noname-abstracts.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/optimize/float-noname-abstracts.yaml new file mode 100644 index 0000000000..4918fc172f --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/optimize/float-noname-abstracts.yaml @@ -0,0 +1,32 @@ +# The MIT License (MIT) +# +# Copyright (c) 2016-2024 Objectionary.com +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. +--- +xsls: + - /org/eolang/parser/optimize/abstracts-float-up.xsl + - /org/eolang/parser/clean-up.xsl +tests: + - /program/objects[count(o)=2] +eo: | + # No comments. + [x] > foo + bar > @ + zzz 42 > [t] diff --git a/eo-runtime/pom.xml b/eo-runtime/pom.xml index bb44157ced..7f2c4796b8 100644 --- a/eo-runtime/pom.xml +++ b/eo-runtime/pom.xml @@ -217,7 +217,6 @@ SOFTWARE. register deps assemble - lint transpile copy unplace @@ -240,7 +239,6 @@ SOFTWARE. register deps assemble - lint transpile binarize