diff --git a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java index ebf2d62364..fe425060bd 100644 --- a/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java +++ b/eo-maven-plugin/src/main/java/org/eolang/maven/PhiMojo.java @@ -24,25 +24,29 @@ package org.eolang.maven; import com.jcabi.log.Logger; +import com.jcabi.xml.XML; import com.jcabi.xml.XMLDocument; -import com.jcabi.xml.XSLDocument; +import com.yegor256.xsline.Shift; +import com.yegor256.xsline.StClasspath; +import com.yegor256.xsline.TrDefault; +import com.yegor256.xsline.Train; +import com.yegor256.xsline.Xsline; import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; import org.apache.maven.plugins.annotations.LifecyclePhase; import org.apache.maven.plugins.annotations.Mojo; import org.apache.maven.plugins.annotations.Parameter; -import org.cactoos.Text; import org.cactoos.experimental.Threads; -import org.cactoos.io.ResourceOf; import org.cactoos.iterable.Mapped; import org.cactoos.number.SumOf; -import org.cactoos.text.Sticky; import org.cactoos.text.TextOf; import org.eolang.maven.util.HmBase; import org.eolang.maven.util.Home; import org.eolang.maven.util.Rel; import org.eolang.maven.util.Walk; +import org.eolang.parser.ParsingTrain; +import org.eolang.parser.Schema; /** * Read XMIR files and translate them to the phi-calculus expression. @@ -59,15 +63,6 @@ public final class PhiMojo extends SafeMojo { */ public static final String EXT = "phi"; - /** - * Translation to phi. - */ - private static final Text TRANSLATION = new Sticky( - new TextOf( - new ResourceOf("org/eolang/maven/phi/to-phi.xsl") - ) - ); - /** * The directory where to take xmir files for translation from. * @checkstyle MemberNameCheck (10 lines) @@ -90,21 +85,40 @@ public final class PhiMojo extends SafeMojo { ) private File phiOutputDir; + /** + * Pass XMIR to Optimizations train or not. + * This flag is used for test in order not to optimize XMIR twice: + * in {@link OptimizeMojo} and here. + * @checkstyle MemberNameCheck (5 lines) + */ + @SuppressWarnings("PMD.ImmutableField") + private boolean phiOptimize = true; + @Override public void exec() { final Home home = new HmBase(this.phiOutputDir); + final Train train; + if (this.phiOptimize) { + train = new ParsingTrain(); + } else { + train = new TrDefault<>(); + } final int count = new SumOf( new Threads<>( Runtime.getRuntime().availableProcessors(), new Mapped<>( xmir -> () -> { + final XML xml = new XMLDocument( + new TextOf(xmir).asString() + ); + new Schema(xml).check(); final Path relative = Paths.get( this.phiInputDir.toPath().relativize(xmir).toString().replace( String.format(".%s", TranspileMojo.EXT), String.format(".%s", PhiMojo.EXT) ) ); - home.save(PhiMojo.translated(new TextOf(xmir)), relative); + home.save(PhiMojo.translated(train, xml), relative); Logger.info( this, "Translated to phi: %s -> %s", @@ -131,13 +145,16 @@ count, new Rel(this.phiInputDir), new Rel(this.phiOutputDir) /** * Translate given xmir to phi calculus expression. + * @param train Train that optimize and traslates given xmir * @param xmir Text of xmir * @return Translated xmir - * @throws Exception If fail to translate */ - private static String translated(final Text xmir) throws Exception { - return new XSLDocument(PhiMojo.TRANSLATION.asString()).applyTo( - new XMLDocument(xmir.asString()) - ); + private static String translated(final Train train, final XML xmir) { + return new Xsline( + train.with(new StClasspath("/org/eolang/maven/phi/to-phi.xsl")) + ) + .pass(xmir) + .xpath("phi/text()") + .get(0); } } diff --git a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl index 77da717015..4002ef2855 100644 --- a/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl +++ b/eo-maven-plugin/src/main/resources/org/eolang/maven/phi/to-phi.xsl @@ -24,6 +24,7 @@ SOFTWARE. --> + @@ -73,6 +74,7 @@ SOFTWARE. + @@ -80,6 +82,7 @@ SOFTWARE. . + @@ -138,6 +141,7 @@ SOFTWARE. + @@ -158,44 +162,71 @@ SOFTWARE. + + - , + , + + + + + + + + + - { - - - - - - - - - - - - - - - Package - - - - - - - - } + + { + + + + + + + + + + + + + + + + + + + + + + Package + + + + + + + + + + + + } + + - - + + + + @@ -230,6 +261,7 @@ SOFTWARE. + @@ -251,63 +283,85 @@ SOFTWARE. ( + + + ) - + + + ( + + + ) + + + Only 'bytes' is allowed as 'data' attribute to convert to phi-calculus expression. Given: + + + ( + + ) + + Lambda - , + - - + + + + + + - + @@ -321,7 +375,9 @@ 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 43d1107fd5..60efd84b65 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 @@ -238,6 +238,7 @@ public FakeMaven execute(final Class mojo) throws IO this.params.putIfAbsent("objectionaries", new Objectionaries.Fake()); this.params.putIfAbsent("rewriteBinaries", true); this.params.putIfAbsent("offline", false); + this.params.putIfAbsent("phiOptimize", false); this.params.putIfAbsent( "eoPortalDir", new File("../eo-runtime/src/main/rust/eo") diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/atoms.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/atoms.yaml index 40dccf7ccd..17c39f1070 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/atoms.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/atoms.yaml @@ -2,5 +2,14 @@ eo: | [] > main /int [] > outer [] > inner /bytes -phi: - "{main ↦ ⟦λ ⤍ Lambda⟧, outer ↦ ⟦inner ↦ ⟦λ ⤍ Lambda⟧⟧}" \ No newline at end of file +phi: | + { + main ↦ ⟦ + λ ⤍ Lambda + ⟧, + outer ↦ ⟦ + inner ↦ ⟦ + λ ⤍ Lambda + ⟧ + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/bindings.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/bindings.yaml index 07a27790c0..53fee55501 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/bindings.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/bindings.yaml @@ -4,5 +4,18 @@ eo: | [z]:abs w > @ 5:five -phi: - "{xyz ↦ Φ.org.eolang.x(attr ↦ Φ.org.eolang.y, abs ↦ ⟦z ↦ ∅, φ ↦ Φ.org.eolang.w⟧, five ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-05)))}" \ No newline at end of file +phi: | + { + xyz ↦ Φ.org.eolang.x( + attr ↦ Φ.org.eolang.y, + abs ↦ ⟦ + z ↦ ∅, + φ ↦ Φ.org.eolang.w + ⟧, + five ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-05 + ) + ) + ) + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/custom-alias.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/custom-alias.yaml index 2f542bf5ca..bb40ecb9a1 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/custom-alias.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/custom-alias.yaml @@ -4,4 +4,18 @@ eo: | [y] > main x y > z -phi: "{foo ↦ ⟦bar ↦ ⟦main ↦ ⟦y ↦ ∅, z ↦ Φ.com.yegor256.x(α0 ↦ ξ.y)⟧, λ ⤍ Package⟧, λ ⤍ Package⟧}" \ No newline at end of file +phi: | + { + foo ↦ ⟦ + bar ↦ ⟦ + main ↦ ⟦ + y ↦ ∅, + z ↦ Φ.com.yegor256.x( + α0 ↦ ξ.y + ) + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/empty-bytes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/empty-bytes.yaml index 34a3b65221..de280c32d5 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/empty-bytes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/empty-bytes.yaml @@ -1,2 +1,7 @@ eo: -- > empty -phi: "{empty ↦ Φ.org.eolang.bytes(Δ ⤍ --)}" \ No newline at end of file +phi: | + { + empty ↦ Φ.org.eolang.bytes( + Δ ⤍ -- + ) + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/fibonaci.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/fibonaci.yaml index d6be21b86e..87f4cca69a 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/fibonaci.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/fibonaci.yaml @@ -12,4 +12,43 @@ eo: | n.minus 1 fibonacci n.minus 2 -phi: "{eo ↦ ⟦example ↦ ⟦fibonacci ↦ ⟦n ↦ ∅, φ ↦ ξ.n.lt(α0 ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-02))).if(α0 ↦ ξ.n, α1 ↦ ξ.ρ.fibonacci(α0 ↦ ξ.n.minus(α0 ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-01)))).plus(α0 ↦ ξ.ρ.fibonacci(α0 ↦ ξ.n.minus(α0 ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-02))))))⟧, λ ⤍ Package⟧, λ ⤍ Package⟧}" \ No newline at end of file +phi: | + { + eo ↦ ⟦ + example ↦ ⟦ + fibonacci ↦ ⟦ + n ↦ ∅, + φ ↦ ξ.n.lt( + α0 ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-02 + ) + ) + ).if( + α0 ↦ ξ.n, + α1 ↦ ξ.ρ.fibonacci( + α0 ↦ ξ.n.minus( + α0 ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-01 + ) + ) + ) + ).plus( + α0 ↦ ξ.ρ.fibonacci( + α0 ↦ ξ.n.minus( + α0 ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-02 + ) + ) + ) + ) + ) + ) + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/full-path.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/full-path.yaml index 5b64bd8ce3..c03eb98c22 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/full-path.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/full-path.yaml @@ -1,5 +1,8 @@ eo: | QQ.io.stdout > std Q.org.eolang.x > y -phi: - "{std ↦ Φ.org.eolang.io.stdout, y ↦ Φ.org.eolang.x}" \ No newline at end of file +phi: | + { + std ↦ Φ.org.eolang.io.stdout, + y ↦ Φ.org.eolang.x + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/jeo-part.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/jeo-part.yaml new file mode 100644 index 0000000000..8774785dde --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/jeo-part.yaml @@ -0,0 +1,40 @@ +eo: | + +package org.eolang.benchmark + + [] > j$A + 32 > access + "java/lang/Object" > supername + * > interfaces + "org/eolang/benchmark/F" +phi: | + { + org ↦ ⟦ + eolang ↦ ⟦ + benchmark ↦ ⟦ + j$A ↦ ⟦ + access ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-20 + ) + ), + supername ↦ Φ.org.eolang.string( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 6A-61-76-61-2F-6C-61-6E-67-2F-4F-62-6A-65-63-74 + ) + ), + interfaces ↦ Φ.org.eolang.tuple( + α0 ↦ Φ.org.eolang.tuple.empty, + α1 ↦ Φ.org.eolang.string( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 6F-72-67-2F-65-6F-6C-61-6E-67-2F-62-65-6E-63-68-6D-61-72-6B-2F-46 + ) + ) + ) + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/method.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/method.yaml index 309b7b901a..5316ab69d9 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/method.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/method.yaml @@ -1,2 +1,5 @@ eo: x.y.z > xyz -phi: "{xyz ↦ Φ.org.eolang.x.y.z}" \ No newline at end of file +phi: | + { + xyz ↦ Φ.org.eolang.x.y.z + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/nested.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/nested.yaml index a266f9720b..71f6503f13 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/nested.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/nested.yaml @@ -7,4 +7,25 @@ eo: | main 5 > five a > b d > e -phi: "{main ↦ ⟦a ↦ ∅, x ↦ ⟦y ↦ ⟦d ↦ ξ.ρ.ρ.a, z ↦ ⟦five ↦ ξ.ρ.ρ.ρ.ρ.main(α0 ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-05))), b ↦ ξ.ρ.ρ.ρ.a, e ↦ ξ.ρ.d⟧⟧⟧⟧}" \ No newline at end of file +phi: | + { + main ↦ ⟦ + a ↦ ∅, + x ↦ ⟦ + y ↦ ⟦ + d ↦ ξ.ρ.ρ.a, + z ↦ ⟦ + five ↦ ξ.ρ.ρ.ρ.ρ.main( + α0 ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-05 + ) + ) + ), + b ↦ ξ.ρ.ρ.ρ.a, + e ↦ ξ.ρ.d + ⟧ + ⟧ + ⟧ + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/one-byte.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/one-byte.yaml index 284f3dcfd2..a6e82afea9 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/one-byte.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/one-byte.yaml @@ -1,2 +1,7 @@ eo: A2- > bts -phi: "{bts ↦ Φ.org.eolang.bytes(Δ ⤍ A2-)}" \ No newline at end of file +phi: | + { + bts ↦ Φ.org.eolang.bytes( + Δ ⤍ A2- + ) + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/package.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/package.yaml index 26d86454b1..0f5d6c3964 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/package.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/package.yaml @@ -3,4 +3,18 @@ eo: | [] > main stdout > @ -phi: "{foo ↦ ⟦bar ↦ ⟦baz ↦ ⟦main ↦ ⟦φ ↦ Φ.org.eolang.stdout⟧, λ ⤍ Package⟧, λ ⤍ Package⟧, λ ⤍ Package⟧}" \ No newline at end of file +phi: | + { + foo ↦ ⟦ + bar ↦ ⟦ + baz ↦ ⟦ + main ↦ ⟦ + φ ↦ Φ.org.eolang.stdout + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧, + λ ⤍ Package + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/specials.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/specials.yaml index 2cc1018000..abccecb6fe 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/specials.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/specials.yaml @@ -6,4 +6,14 @@ eo: | < > vtx ^.< > self @.@ > phi -phi: "{main ↦ ⟦x ↦ ξ.ρ.x, h ↦ Φ.org.eolang.y.σ, a ↦ ξ.a, vtx ↦ ξ.ν, self ↦ ξ.ρ.ν, phi ↦ ξ.φ.φ⟧}" \ No newline at end of file +phi: | + { + main ↦ ⟦ + x ↦ ξ.ρ.x, + h ↦ Φ.org.eolang.y.σ, + a ↦ ξ.a, + vtx ↦ ξ.ν, + self ↦ ξ.ρ.ν, + phi ↦ ξ.φ.φ + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-data.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-data.yaml index f5333e55a8..8713c553b6 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-data.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-data.yaml @@ -1,2 +1,9 @@ eo: 5 > five -phi: "{five ↦ Φ.org.eolang.int(α0 ↦ Φ.org.eolang.bytes(Δ ⤍ 00-00-00-00-00-00-00-05))}" +phi: | + { + five ↦ Φ.org.eolang.int( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 00-00-00-00-00-00-00-05 + ) + ) + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-free-attributes.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-free-attributes.yaml index de5353fb8c..633ad837fd 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-free-attributes.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/with-free-attributes.yaml @@ -1,5 +1,11 @@ eo: | [a b] > c d > @ -phi: - "{c ↦ ⟦a ↦ ∅, b ↦ ∅, φ ↦ Φ.org.eolang.d⟧}" \ No newline at end of file +phi: | + { + c ↦ ⟦ + a ↦ ∅, + b ↦ ∅, + φ ↦ Φ.org.eolang.d + ⟧ + } \ No newline at end of file diff --git a/eo-parser/src/main/java/org/eolang/parser/ParsingTrain.java b/eo-parser/src/main/java/org/eolang/parser/ParsingTrain.java index d73f65bec4..c1cefd23bb 100644 --- a/eo-parser/src/main/java/org/eolang/parser/ParsingTrain.java +++ b/eo-parser/src/main/java/org/eolang/parser/ParsingTrain.java @@ -121,36 +121,39 @@ public ParsingTrain() { */ ParsingTrain(final String... sheets) { super( - new TrJoined<>( - new TrDefault<>( - new StEndless( - new StLambda(ParsingTrain.TUPLES::transform) - ) - ), - new TrLambda( - new TrFast( - new TrLambda( - new TrLogged( - new TrClasspath<>(sheets).back(), - ParsingTrain.class, - Level.FINEST + new TrLambda( + new TrFast( + new TrLambda( + new TrLogged( + new TrJoined<>( + new TrDefault<>( + new StEndless( + new StLambda( + "stars-to-tuples", + ParsingTrain.TUPLES::transform + ) + ) + ), + new TrClasspath<>(sheets).back() ), - StEoLogged::new + ParsingTrain.class, + Level.FINEST ), - TrFast.class, - 500L + StEoLogged::new ), - shift -> new StSequence( - shift.uid(), - xml -> xml.nodes("//error[@severity='critical']").isEmpty(), - new StAfter( - shift, - new StLambda( - shift::uid, - (pos, xml) -> ParsingTrain.EACH.with("step", pos) - .with("sheet", shift.uid()) - .transform(xml) - ) + TrFast.class, + 500L + ), + shift -> new StSequence( + shift.uid(), + xml -> xml.nodes("//error[@severity='critical']").isEmpty(), + new StAfter( + shift, + new StLambda( + shift::uid, + (pos, xml) -> ParsingTrain.EACH.with("step", pos) + .with("sheet", shift.uid()) + .transform(xml) ) ) ) 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 0b25cd0b4d..2162b5a868 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XePhiListener.java @@ -298,7 +298,7 @@ public void exitDeltaBidning(final PhiParser.DeltaBidningContext ctx) { @Override public void enterLambdaBidning(final PhiParser.LambdaBidningContext ctx) { if (!ctx.FUNCTION().getText().equals(XePhiListener.LAMBDA_PACKAGE)) { - this.objects().prop("atom"); + this.objects().prop("atom", "?"); } } diff --git a/eo-parser/src/main/resources/XMIR.xsd b/eo-parser/src/main/resources/XMIR.xsd index 7f9e34ffdf..ec517a7b73 100644 --- a/eo-parser/src/main/resources/XMIR.xsd +++ b/eo-parser/src/main/resources/XMIR.xsd @@ -68,6 +68,7 @@ SOFTWARE. + @@ -78,6 +79,8 @@ SOFTWARE. + + @@ -103,7 +106,8 @@ SOFTWARE. - + + diff --git a/eo-parser/src/main/resources/org/eolang/parser/errors/external-weak-typed-atoms.xsl b/eo-parser/src/main/resources/org/eolang/parser/errors/external-weak-typed-atoms.xsl index b69bc1de59..41fb0480e6 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/errors/external-weak-typed-atoms.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/errors/external-weak-typed-atoms.xsl @@ -40,9 +40,6 @@ SOFTWARE. error - - - Weak typing /? is allowed only inside org.eolang package diff --git a/eo-parser/src/test/java/org/eolang/parser/ParsingTrainTest.java b/eo-parser/src/test/java/org/eolang/parser/ParsingTrainTest.java index cf73d50e28..6824380743 100644 --- a/eo-parser/src/test/java/org/eolang/parser/ParsingTrainTest.java +++ b/eo-parser/src/test/java/org/eolang/parser/ParsingTrainTest.java @@ -73,7 +73,7 @@ void stopsPipeline() { new ParsingTrain() ).pass(xml), XhtmlMatchers.hasXPaths( - "/program/sheets[count(sheet)=2]", + "/program/sheets[count(sheet)=3]", "/program/errors/error[@severity='critical']" ) );