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 b562dbfdc3..fe3f9c45b1 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 @@ -28,10 +28,12 @@ import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.Collection; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; +import org.cactoos.experimental.Threads; +import org.cactoos.iterable.Mapped; +import org.cactoos.number.SumOf; import org.cactoos.text.TextOf; import org.eolang.maven.util.HmBase; import org.eolang.maven.util.Home; @@ -72,23 +74,31 @@ public final class PrintMojo extends SafeMojo { @Override void exec() throws IOException { - final Collection sources = new Walk(this.printSourcesDir.toPath()); final Home home = new HmBase(this.printOutputDir); - for (final Path source : sources) { - final Path relative = Paths.get( - this.printSourcesDir.toPath().relativize(source).toString() - .replace(".xmir", ".eo") - ); - home.save(new XMIR(new TextOf(source)).toEO(), relative); - Logger.info( - this, - "Printed: %s => %s", source, this.printOutputDir.toPath().resolve(relative) - ); - } - if (sources.isEmpty()) { + final int total = new SumOf( + new Threads<>( + Runtime.getRuntime().availableProcessors(), + new Mapped<>( + source -> () -> { + final Path relative = Paths.get( + this.printSourcesDir.toPath().relativize(source).toString() + .replace(".xmir", ".eo") + ); + home.save(new XMIR(new TextOf(source)).toEO(), relative); + Logger.info( + this, + "Printed: %s => %s", source, this.printOutputDir.toPath().resolve(relative) + ); + return 1; + }, + new Walk(this.printSourcesDir.toPath()) + ) + ) + ).intValue(); + if (total == 0) { Logger.info(this, "No XMIR sources found"); } else { - Logger.info(this, "Printed %d XMIR sources into EO", sources.size()); + Logger.info(this, "Printed %d XMIR sources into EO", total); } } } diff --git a/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/binded-reversed-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/binded-reversed-application.yaml new file mode 100644 index 0000000000..f92c36da87 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/packs/syntax/binded-reversed-application.yaml @@ -0,0 +1,14 @@ +# @todo #2729:60min Enable the test when it's possible. Current syntax is not supported now. In our +# EBNF such is understood as vertical application with 3 arguments. But all arguments in +# application must be either all bound or not. But it should not be like that with reversed +# application. Need to extend the grammar and make sure the test works. Don't forget to remove the +# puzzle. +skip: true +xsls: [] +tests: + - /program/errors[count(*)=0] +eo: | + if. > condition + TRUE + "TRUE":0 + "FALSE":1 \ No newline at end of file