Skip to content

Commit

Permalink
Merge branch 'master' into feat/#3251/windows-socket-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
maxonfjvipon committed Sep 25, 2024
2 parents 9c2feae + 6427056 commit 24b371c
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/zerocracy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: zerocracy/[email protected].52
- uses: zerocracy/[email protected].53
with:
token: ${{ secrets.ZEROCRACY_TOKEN }}
options: |
github_token=${{ secrets.GITHUB_TOKEN }}
vitals_url=https://www.eolang.org/zerocracy/objectionary-vitals.html
repositories=objectionary/*
factbase: objectionary.fb
- uses: zerocracy/[email protected].34
- uses: zerocracy/[email protected].35
with:
factbase: objectionary.fb
output: pages
Expand Down
4 changes: 2 additions & 2 deletions eo-maven-plugin/src/it/rewritten_sources/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ SOFTWARE.
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
17 changes: 11 additions & 6 deletions eo-maven-plugin/src/main/java/org/eolang/maven/UnphiMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import org.apache.maven.plugins.annotations.LifecyclePhase;
Expand Down Expand Up @@ -104,7 +103,7 @@ public final class UnphiMojo extends SafeMojo {

@Override
public void exec() {
final List<Path> errors = new ListOf<>();
final List<String> errors = new ListOf<>();
final Home home = new HmBase(this.unphiOutputDir);
final Iterable<Directive> metas = new UnphiMojo.Metas(this.unphiMetas);
final int count = new SumOf(
Expand All @@ -119,7 +118,7 @@ public void exec() {
String.format(".%s", TranspileMojo.EXT)
)
);
final XML result = TRANSFORMATIONS.pass(
final XML result = UnphiMojo.TRANSFORMATIONS.pass(
new PhiSyntax(
phi.getFileName().toString().replace(".phi", ""),
new TextOf(phi),
Expand All @@ -133,7 +132,13 @@ public void exec() {
phi, this.unphiOutputDir.toPath().resolve(xmir)
);
if (result.nodes("//errors[count(error)=0]").isEmpty()) {
errors.add(relative);
errors.add(
String.format(
"%s:\n\t%s\n",
relative,
String.join("\n\t", result.xpath("//errors/error/text()"))
)
);
}
return 1;
},
Expand All @@ -145,9 +150,9 @@ public void exec() {
if (!errors.isEmpty()) {
throw new IllegalStateException(
String.format(
"%d files with parsing errors were found: %s",
"%d files with parsing errors were found:\n%s",
errors.size(),
Arrays.toString(errors.toArray())
String.join("\n", errors)
)
);
}
Expand Down
30 changes: 24 additions & 6 deletions eo-parser/src/main/java/org/eolang/parser/EoSyntax.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@
public final class EoSyntax implements Syntax {

/**
* The name of it.
* The name of the EO program being parsed, usually the name of
* <tt>.eo</tt> file itself. This name will be present in the
* generated XML. This is done for the sake of traceability: it will
* always be possible to tell which XMIR file was generated from
* which EO program.
*/
private final String name;

Expand All @@ -61,8 +65,18 @@ public final class EoSyntax implements Syntax {
/**
* Ctor.
*
* @param nme The name of it
* @param ipt Input text
* @param ipt The EO program to parse
* @since 0.40.0
*/
public EoSyntax(final Input ipt) {
this("unknown", 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 Input ipt) {
this.name = nme;
Expand Down Expand Up @@ -99,11 +113,15 @@ public XML parsed() throws IOException {
);
new Schema(dom).check();
if (spy.size() == 0) {
Logger.debug(this, "Input of %d EO lines compiled, no errors", lines.size());
Logger.debug(
this,
"The %s program of %d EO lines compiled, no errors",
this.name, lines.size()
);
} else {
Logger.debug(
this, "Input of %d EO lines failed to compile (%d errors)",
lines.size(), spy.size()
this, "The %s program of %d EO lines failed to compile (%d errors)",
this.name, lines.size(), spy.size()
);
}
return dom;
Expand Down
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,26 +140,26 @@ SOFTWARE.
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<type>pom</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.10.3</version>
<version>5.11.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down

0 comments on commit 24b371c

Please sign in to comment.