From 06c4813fa42cfc2a8a47860ca2e87e73c8d1d98f Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 18:47:30 +0200 Subject: [PATCH 01/23] test(eo-parser): add test case for auto phi formation with application precedence --- ...i-formation-with-application-precedence.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml new file mode 100644 index 00000000000..a47d760b525 --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml @@ -0,0 +1,17 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵46' and o[@name='φ' and @base='.contains']] +input: | + [cont-list] > custom-map + mapped. > @ + cont-list + (text orgn).contains x >> [x] + origin > orgn! + + [] > foo + ((text orgn).contains b).ttt >> [y] From 9bdb52f7253e22b803690325395b0ff838be6cdd Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 18:50:03 +0200 Subject: [PATCH 02/23] test: update test cases to reflect new auto phi formation behavior with application precedence --- .../java/org/eolang/parser/XeEoListener.java | 16 +++++++++++++++- ...hi-formation-with-application-precedence.yaml | 8 ++++---- ...o-phi-formation-with-nested-vapplication.yaml | 4 ++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index cffdb8963b8..efe0d6ee31f 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -10,6 +10,8 @@ import java.util.Iterator; import java.util.List; import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.Token; @@ -35,6 +37,11 @@ "PMD.GodClass" }) final class XeEoListener implements EoListener, Iterable { + /** + * Application precedence. + */ + private static final Pattern APPLICATION_PRECEDENCE = Pattern.compile("\\([^()]*\\)\\.(\\w+)"); + /** * Xembly directives we are building (mutable). */ @@ -1210,10 +1217,17 @@ private String alphaAttr(final ParserRuleContext ctx, final String msg) { * @param application Application base */ private void startAutoPhiFormation(final ParserRuleContext ctx, final String application) { + final Matcher matcher = XeEoListener.APPLICATION_PRECEDENCE.matcher(application); + final String abase; + if (matcher.find()) { + abase = String.format(".%s", matcher.group(1)); + } else { + abase = String.format("ξ.ρ.%s", application); + } this.startAbstract(ctx) .enter().prop("name", new AutoName(ctx, "p").asString()) .start(ctx) - .prop("base", String.format("ξ.ρ.%s", application)) + .prop("base", abase) .prop("name", "φ"); } diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml index a47d760b525..e4dd2b05650 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml @@ -5,13 +5,13 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵46' and o[@name='φ' and @base='.contains']] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.what']] + - //o[not(@base) and @name='ap🌵66' and o[@name='φ' and @base='.contains']] input: | [cont-list] > custom-map + foo > boom + ((text orgn).what b).ttt >> [y] mapped. > @ cont-list (text orgn).contains x >> [x] origin > orgn! - - [] > foo - ((text orgn).contains b).ttt >> [y] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-nested-vapplication.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-nested-vapplication.yaml index 0d12aeaa677..793f4ac3b23 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-nested-vapplication.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-nested-vapplication.yaml @@ -5,8 +5,8 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='a🌵34' and o[2][@name='i' and @base='∅'] and o[3][@name='φ']] - - //o[@base='Φ.org.eolang.foo' and o[@base='ξ.a🌵34']] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='i' and @base='∅'] and o[3][@name='φ']] + - //o[@base='Φ.org.eolang.foo' and o[@base='ξ.ap🌵34']] input: | [] > main foo > @ From da6473873aab60c3e3dd1f238d9544806e16f466 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 19:01:56 +0200 Subject: [PATCH 03/23] refactor(XeEoListener): rename APPLICATION_PRECEDENCE to A_PRECEDENCE for brevity and consistency --- eo-parser/src/main/java/org/eolang/parser/XeEoListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index efe0d6ee31f..42bf4fbbe51 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -40,7 +40,7 @@ final class XeEoListener implements EoListener, Iterable { /** * Application precedence. */ - private static final Pattern APPLICATION_PRECEDENCE = Pattern.compile("\\([^()]*\\)\\.(\\w+)"); + private static final Pattern A_PRECEDENCE = Pattern.compile("\\([^()]*\\)\\.(\\w+)"); /** * Xembly directives we are building (mutable). @@ -1217,7 +1217,7 @@ private String alphaAttr(final ParserRuleContext ctx, final String msg) { * @param application Application base */ private void startAutoPhiFormation(final ParserRuleContext ctx, final String application) { - final Matcher matcher = XeEoListener.APPLICATION_PRECEDENCE.matcher(application); + final Matcher matcher = XeEoListener.A_PRECEDENCE.matcher(application); final String abase; if (matcher.find()) { abase = String.format(".%s", matcher.group(1)); From 554385c8eeabf9f286a17a58ec5b911d524c75aa Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 19:24:26 +0200 Subject: [PATCH 04/23] bug(#4559): add new transpile pack for auto phi formation with application precedence --- ...formation-with-application-precedence.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml new file mode 100644 index 00000000000..d54821daaba --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml @@ -0,0 +1,21 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +sheets: + - /org/eolang/maven/transpile/set-locators.xsl + - /org/eolang/maven/transpile/set-original-names.xsl + - /org/eolang/maven/transpile/classes.xsl + - /org/eolang/maven/transpile/tests.xsl + - /org/eolang/maven/transpile/attrs.xsl + - /org/eolang/maven/transpile/data.xsl + - /org/eolang/maven/transpile/to-java.xsl +asserts: + - /object[not(errors)] + - //java[contains(text(), 'Phi r1 = new PhMethod(h, "ap🌵44");')] + - //java[contains(text(), 'Phi r2 = new PhMethod(h, "ap🌵54");')] +input: | + # Foo. + [] > main + foo > app + 2.plus 3 >> [x] + 1.plus 1 >> [y] From d2f225707fa6ea75871b12abe18e2eb81146cef1 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 19:25:55 +0200 Subject: [PATCH 05/23] bug(#4559): add new transpile pack for auto phi formation with application precedence --- ...formation-with-application-precedence.yaml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml index d54821daaba..d1efcee3a72 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml @@ -11,11 +11,16 @@ sheets: - /org/eolang/maven/transpile/to-java.xsl asserts: - /object[not(errors)] - - //java[contains(text(), 'Phi r1 = new PhMethod(h, "ap🌵44");')] - - //java[contains(text(), 'Phi r2 = new PhMethod(h, "ap🌵54");')] + - //java[contains(text(), 'Φ.custom-map.ap🌵46.φ')] + - //java[contains(text(), 'Φ.custom-map.ap🌵46.φ.ρ.ρ.α0')] + - //java[contains(text(), 'Phi rrbbb = Phi.Φ.take("org").take("eolang").take("text");')] + - //java[contains(text(), 'Phi rrbb1 = Phi.Φ.take("org").take("eolang").take("b");')] + - //java[contains(text(), 'rrbbb1 = new PhMethod(rrbbb1, "orgn");')] + - //java[contains(text(), 'Phi rrbb = new PhMethod(rrbbb, "what");')] + - //java[contains(text(), 'Phi rrb = new PhMethod(rrbb, "ttt");')] input: | - # Foo. - [] > main - foo > app - 2.plus 3 >> [x] - 1.plus 1 >> [y] + [cont-list] > custom-map + mapped. > @ + cont-list + ((text orgn).what b).ttt >> [y] + origin > orgn! From 2ebe6273722f02129c6a07746fe8e3dacc7fe72f Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 17 Sep 2025 19:59:33 +0200 Subject: [PATCH 06/23] bug(#4559): last application --- ...to-phi-formation-with-application-precedence.yaml | 11 ++++++----- .../main/java/org/eolang/parser/XeEoListener.java | 12 +++++++----- ...to-phi-formation-with-application-precedence.yaml | 7 +++++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml index d1efcee3a72..81a783d1b05 100644 --- a/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/transpile-packs/transpiles-auto-phi-formation-with-application-precedence.yaml @@ -1,6 +1,7 @@ # SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com # SPDX-License-Identifier: MIT --- +# yamllint disable rule:line-length sheets: - /org/eolang/maven/transpile/set-locators.xsl - /org/eolang/maven/transpile/set-original-names.xsl @@ -13,11 +14,11 @@ asserts: - /object[not(errors)] - //java[contains(text(), 'Φ.custom-map.ap🌵46.φ')] - //java[contains(text(), 'Φ.custom-map.ap🌵46.φ.ρ.ρ.α0')] - - //java[contains(text(), 'Phi rrbbb = Phi.Φ.take("org").take("eolang").take("text");')] - - //java[contains(text(), 'Phi rrbb1 = Phi.Φ.take("org").take("eolang").take("b");')] - - //java[contains(text(), 'rrbbb1 = new PhMethod(rrbbb1, "orgn");')] - - //java[contains(text(), 'Phi rrbb = new PhMethod(rrbbb, "what");')] - - //java[contains(text(), 'Phi rrb = new PhMethod(rrbb, "ttt");')] + - //java[contains(text(), 'Phi rrbb = Phi.Φ.take("org").take("eolang").take("text");')] + - //java[contains(text(), 'rrbb1 = new PhMethod(rrbb1, "orgn");')] + - //java[contains(text(), 'Phi rrb = new PhMethod(rrbb, "what");')] + - //java[contains(text(), 'Phi rrb1 = Phi.Φ.take("org").take("eolang").take("b");')] + - //java[contains(text(), 'Phi rr = new PhMethod(rrb, "ttt");')] input: | [cont-list] > custom-map mapped. > @ diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index 42bf4fbbe51..9ec9ec69e32 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -38,9 +38,9 @@ }) final class XeEoListener implements EoListener, Iterable { /** - * Application precedence. + * Last application. */ - private static final Pattern A_PRECEDENCE = Pattern.compile("\\([^()]*\\)\\.(\\w+)"); + private static final Pattern LAST_APPLICATION = Pattern.compile("\\)\\.([a-zA-Z_]\\w*)$"); /** * Xembly directives we are building (mutable). @@ -1217,10 +1217,12 @@ private String alphaAttr(final ParserRuleContext ctx, final String msg) { * @param application Application base */ private void startAutoPhiFormation(final ParserRuleContext ctx, final String application) { - final Matcher matcher = XeEoListener.A_PRECEDENCE.matcher(application); - final String abase; + final Matcher matcher = XeEoListener.LAST_APPLICATION.matcher(application); + String abase; if (matcher.find()) { - abase = String.format(".%s", matcher.group(1)); + do { + abase = String.format(".%s", matcher.group(1)); + } while (matcher.find()); } else { abase = String.format("ξ.ρ.%s", application); } diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml index e4dd2b05650..6fc15819b36 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml @@ -5,12 +5,15 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.what']] - - //o[not(@base) and @name='ap🌵66' and o[@name='φ' and @base='.contains']] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.ttt']/o[@base='.what']/o[@base='Φ.org.eolang.text']/o[@base='ξ.ρ.orgn']] + - //o[not(@base) and @name='ap🌵54' and o[@name='φ' and @base='.g']/o[@base='.e']/o[@base='.c']] + - //o[not(@base) and @name='ap🌵86' and o[@name='φ' and @base='.contains']/o[@base='Φ.org.eolang.text']/o[@base='ξ.ρ.orgn']] input: | [cont-list] > custom-map foo > boom ((text orgn).what b).ttt >> [y] + bar > dummy + (((a b).c d).e f).g >> [v] mapped. > @ cont-list (text orgn).contains x >> [x] From 32c2eec1584b250fdd25d13b71d5f2bddc585611 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Fri, 19 Sep 2025 09:12:58 +0200 Subject: [PATCH 07/23] bug(#4559): add auto-phi-with-application-precendence.yaml test resource for EO snippets --- ...auto-phi-with-application-precendence.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml diff --git a/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml b/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml new file mode 100644 index 00000000000..262c9e4911c --- /dev/null +++ b/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml @@ -0,0 +1,19 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +out: [] +file: org/eolang/snippets/auto.eo +args: ["org.eolang.snippets.auto"] +eo: | + +alias org.eolang.io.stdout + +package org.eolang.snippets + + # No comments. + [] > auto + malloc.of > @ + 8 + [m] + while > @ + m.get.eq 42 >> [i] + m.put 42 >> [i] From 18aeaafafb3cae301a38e792d1706ea6d9f69a9b Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Fri, 19 Sep 2025 09:13:53 +0200 Subject: [PATCH 08/23] bug(#4559): refine XSL template to exclude positioned objects from auto-phi cleanup --- ...auto-phi-with-application-precendence.yaml | 27 ++++++++++++------- .../parse/auto-phi-formation-restruct.xsl | 2 +- ...formation-with-application-precedence.yaml | 1 + 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml b/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml index 262c9e4911c..63cfb302305 100644 --- a/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml +++ b/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml @@ -3,17 +3,24 @@ --- # yamllint disable rule:line-length out: [] -file: org/eolang/snippets/auto.eo -args: ["org.eolang.snippets.auto"] +file: org/eolang/snippets/foo.eo +args: ["org.eolang.snippets.foo"] eo: | +alias org.eolang.io.stdout + +alias org.eolang.txt.text + +alias org.eolang.structs.list +package org.eolang.snippets - # No comments. - [] > auto - malloc.of > @ - 8 - [m] - while > @ - m.get.eq 42 >> [i] - m.put 42 >> [i] + [] > foo + "abcdefghijk" > origin + origin > @ + [cont-list] > custom-map + mapped. > @ + cont-list + (text orgn).contains x >> [x] + origin > orgn! + + [] +> test-custom-map + eq. > @ + list (* true true) + foo.custom-map (list (* "abc" "ghi")) diff --git a/eo-parser/src/main/resources/org/eolang/parser/parse/auto-phi-formation-restruct.xsl b/eo-parser/src/main/resources/org/eolang/parser/parse/auto-phi-formation-restruct.xsl index 82d13169d74..59ae84e57fb 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/parse/auto-phi-formation-restruct.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/parse/auto-phi-formation-restruct.xsl @@ -63,5 +63,5 @@ - + diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml index 6fc15819b36..c77fbfaf78a 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-with-application-precedence.yaml @@ -8,6 +8,7 @@ asserts: - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.ttt']/o[@base='.what']/o[@base='Φ.org.eolang.text']/o[@base='ξ.ρ.orgn']] - //o[not(@base) and @name='ap🌵54' and o[@name='φ' and @base='.g']/o[@base='.e']/o[@base='.c']] - //o[not(@base) and @name='ap🌵86' and o[@name='φ' and @base='.contains']/o[@base='Φ.org.eolang.text']/o[@base='ξ.ρ.orgn']] + - //o[not(@base) and @name='ap🌵86' and o[@name='φ' and @base='.contains']/o[@base='ξ.x']] input: | [cont-list] > custom-map foo > boom From 96763d6e41b114b9c233e3165af1ad710bbb8b4e Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Fri, 19 Sep 2025 09:16:25 +0200 Subject: [PATCH 09/23] bug(#4559): typo --- ...precendence.yaml => auto-phi-with-application-precedence.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename eo-integration-tests/src/test/resources/org/eolang/snippets/{auto-phi-with-application-precendence.yaml => auto-phi-with-application-precedence.yaml} (100%) diff --git a/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml b/eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precedence.yaml similarity index 100% rename from eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precendence.yaml rename to eo-integration-tests/src/test/resources/org/eolang/snippets/auto-phi-with-application-precedence.yaml From eb1c1eb79a8e7cdc0b534937ab4c6efb2e0bcb8a Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 22 Sep 2025 18:35:59 +0200 Subject: [PATCH 10/23] bug(#4559): test case --- .../auto-phi-formation-from-fqn-application.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml new file mode 100644 index 00000000000..e0ba7b8a0eb --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml @@ -0,0 +1,13 @@ + +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='ξ.ρ.number']/o[1][@base='Φ.org.eolang.number']] +input: | + [] > foo + start > @ + Q.org.eolang.number >> [x] From d36d73f0eb27eb6dafc7b77908dfddb5ef338f91 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 22 Sep 2025 21:31:20 +0200 Subject: [PATCH 11/23] bug(#4559): handle fully qualified names in auto-phi formation by stripping Q prefix --- .../src/main/java/org/eolang/parser/XeEoListener.java | 8 +++++++- .../auto-phi-formation-from-fqn-application.yaml | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index 9ec9ec69e32..eb5bccd633c 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1224,7 +1224,13 @@ private void startAutoPhiFormation(final ParserRuleContext ctx, final String app abase = String.format(".%s", matcher.group(1)); } while (matcher.find()); } else { - abase = String.format("ξ.ρ.%s", application); + if (application.startsWith("Q.")) { + abase = String.format( + "ξ.ρ.%s", application.substring(application.lastIndexOf('.') + 1) + ); + } else { + abase = String.format("ξ.ρ.%s", application); + } } this.startAbstract(ctx) .enter().prop("name", new AutoName(ctx, "p").asString()) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml index e0ba7b8a0eb..93a1e57f703 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml @@ -6,8 +6,8 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='ξ.ρ.number']/o[1][@base='Φ.org.eolang.number']] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='ξ.ρ.boom']/o[1][@base='Φ.a.bca.eaa.boom']] input: | [] > foo start > @ - Q.org.eolang.number >> [x] + Q.a.bca.eaa.boom >> [x] From e2a0396bc0414583c6010b8e11c52dd5b336f68e Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 22 Sep 2025 21:37:19 +0200 Subject: [PATCH 12/23] chore(#4559): remove empty line from test resource file --- .../eo-syntax/auto-phi-formation-from-fqn-application.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml index 93a1e57f703..f0a5939f680 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml @@ -1,4 +1,3 @@ - # SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com # SPDX-License-Identifier: MIT --- From ece0c48f3e86598b8cc9007a0608df0705b8b7e0 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Mon, 22 Sep 2025 22:12:03 +0200 Subject: [PATCH 13/23] empty commit to restart pipelines From 7bedfad5c2a4162adc1b330f6f9fc4542fdbca55 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 24 Sep 2025 16:43:10 +0200 Subject: [PATCH 14/23] bug(#4559): add test case for auto phi formation from FQN precedence application --- ...hi-formation-from-fqn-precedence-application.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml new file mode 100644 index 00000000000..7000754b4dd --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='Φ.a.bca.eaa.boom']/o[1][@base='Φ.org.eolang.number']] +input: | + [] > foo + start > @ + Q.a.bca.eaa.boom 42 >> [x] From 82cd9ba59b4bf8bc03ad81ca52dc40173f3a2e4a Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 24 Sep 2025 16:43:37 +0200 Subject: [PATCH 15/23] =?UTF-8?q?bug(#4559):=20simplify=20Q-prefixed=20app?= =?UTF-8?q?lication=20handling=20by=20replacing=20Q=20with=20=CE=A6=20dire?= =?UTF-8?q?ctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/org/eolang/parser/XeEoListener.java | 10 +++------- .../auto-phi-formation-from-fqn-application.yaml | 4 ++-- ...-phi-formation-from-fqn-precedence-application.yaml | 9 +++++---- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index eb5bccd633c..5eb239d1558 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1223,14 +1223,10 @@ private void startAutoPhiFormation(final ParserRuleContext ctx, final String app do { abase = String.format(".%s", matcher.group(1)); } while (matcher.find()); + } else if (application.startsWith("Q.")) { + abase = application.replace("Q.", "Φ."); } else { - if (application.startsWith("Q.")) { - abase = String.format( - "ξ.ρ.%s", application.substring(application.lastIndexOf('.') + 1) - ); - } else { - abase = String.format("ξ.ρ.%s", application); - } + abase = String.format("ξ.ρ.%s", application); } this.startAbstract(ctx) .enter().prop("name", new AutoName(ctx, "p").asString()) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml index f0a5939f680..7000754b4dd 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-application.yaml @@ -5,8 +5,8 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='ξ.ρ.boom']/o[1][@base='Φ.a.bca.eaa.boom']] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='Φ.a.bca.eaa.boom']/o[1][@base='Φ.org.eolang.number']] input: | [] > foo start > @ - Q.a.bca.eaa.boom >> [x] + Q.a.bca.eaa.boom 42 >> [x] diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml index 7000754b4dd..790f553c039 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-fqn-precedence-application.yaml @@ -5,8 +5,9 @@ sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='Φ.a.bca.eaa.boom']/o[1][@base='Φ.org.eolang.number']] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.j']/o[@base='.i']/o[@base='Φ.org.eolang.txt.text']/o[@base='ξ.ρ.args']] + - //o[@base='.i' and not(@name)]/o[2][@base='Φ.org.foo.b'] input: | - [] > foo - start > @ - Q.a.bca.eaa.boom 42 >> [x] + [args] > main + foo > app + ((Q.org.eolang.txt.text args).i Q.org.foo.b).j >> [y] From d9bea3373370976832cdd3e0f24c7e51866d4006 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Wed, 24 Sep 2025 17:16:34 +0200 Subject: [PATCH 16/23] empty commit to restart pipelines From 4ae096fc6dc741ab5023a579b63d3b5ba25448a5 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 13:43:19 +0200 Subject: [PATCH 17/23] bug(#4559): auto-phi formation from application with \rho --- .../java/org/eolang/parser/XeEoListener.java | 43 ++++++++++++++++--- ...i-formation-from-application-with-rho.yaml | 12 ++++++ 2 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-rho.yaml diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index 5eb239d1558..a38fd2a5ba5 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -165,7 +165,9 @@ public void exitObject(final EoParser.ObjectContext ctx) { @Override public void enterBound(final EoParser.BoundContext ctx) { if (ctx.just() != null && ctx.aphi() != null && ctx.just().finisher() != null) { - this.startAutoPhiFormation(ctx, ctx.just().finisher().getText()); + this.startAutoPhiFormation( + ctx, XeEoListener.eoApplicationToXmir(ctx.just().finisher().getText()) + ); } } @@ -374,7 +376,9 @@ public void exitHapplicationExtended(final EoParser.HapplicationExtendedContext @Override public void enterOnlyAphi(final EoParser.OnlyAphiContext ctx) { - this.startAutoPhiFormation(ctx, ctx.happlicationHeadExtended().getText()); + this.startAutoPhiFormation( + ctx, XeEoListener.eoApplicationToXmir(ctx.happlicationHeadExtended().getText()) + ); } @Override @@ -668,7 +672,12 @@ public void enterVapplicationArgUnbound(final EoParser.VapplicationArgUnboundCon final EoParser.VapplicationArgUnboundCurrentContext vertical = ctx.vapplicationArgUnboundCurrent(); if (vertical.just() != null || vertical.method() != null) { - this.startAutoPhiFormation(ctx, XeEoListener.verticalApplicationBase(vertical)); + this.startAutoPhiFormation( + ctx, + XeEoListener.eoApplicationToXmir( + XeEoListener.verticalApplicationBase(vertical) + ) + ); } } else { this.objects.enter(); @@ -706,7 +715,7 @@ public void enterVapplicationArgUnboundNext( ) { if (ctx.aphi() != null) { this.startAutoPhiFormation( - ctx, ctx.vapplicationHead().getText() + ctx, XeEoListener.eoApplicationToXmir(ctx.vapplicationHead().getText()) ); } } @@ -1223,10 +1232,8 @@ private void startAutoPhiFormation(final ParserRuleContext ctx, final String app do { abase = String.format(".%s", matcher.group(1)); } while (matcher.find()); - } else if (application.startsWith("Q.")) { - abase = application.replace("Q.", "Φ."); } else { - abase = String.format("ξ.ρ.%s", application); + abase = application; } this.startAbstract(ctx) .enter().prop("name", new AutoName(ctx, "p").asString()) @@ -1235,6 +1242,28 @@ private void startAutoPhiFormation(final ParserRuleContext ctx, final String app .prop("name", "φ"); } + /** + * EO application to XMIR base. + * @param application Application to transform + * @return Application base in XMIR format + */ + private static String eoApplicationToXmir(final String application) { + final String transformed = application.replace("^.", "ρ."); + final String base; + if (transformed.startsWith("Q.")) { + base = transformed.replace("Q.", "Φ."); + } else { + base = transformed; + } + final String result; + if (base.startsWith("ρ.") || base.startsWith("Φ.")) { + result = base; + } else { + result = String.format("ξ.ρ.%s", base); + } + return result; + } + /** * Trim margin from text block. * diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-rho.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-rho.yaml new file mode 100644 index 00000000000..71a5542995f --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-rho.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='ρ.x.ρ.y.ρ.z']] +input: | + [args] > main + a > x1 + ^.x.^.y.^.z >> [y] From ac2de15143523eb775bc1b8a5b2cf532d917a3d6 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 15:41:22 +0200 Subject: [PATCH 18/23] bug(#4559): extend identifier pattern to support Unicode letters and hyphens in method names --- .../main/java/org/eolang/parser/XeEoListener.java | 2 +- ...-phi-formation-from-application-with-hypens.yaml | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index a38fd2a5ba5..fd1725fdd5a 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -40,7 +40,7 @@ final class XeEoListener implements EoListener, Iterable { /** * Last application. */ - private static final Pattern LAST_APPLICATION = Pattern.compile("\\)\\.([a-zA-Z_]\\w*)$"); + private static final Pattern LAST_APPLICATION = Pattern.compile("\\)\\.(\\p{L}[\\p{L}\\p{N}-]*)$"); /** * Xembly directives we are building (mutable). diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml new file mode 100644 index 00000000000..9732d0129ca --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml @@ -0,0 +1,13 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='.as-j']/o[@base='.as-i']/o[@base='Φ.org.eolang.text']/o[@base='ξ.ρ.args']] + - //o[@base='.as-i' and not(@name)]/o[2][@base='Φ.org.eolang.as-bar.b'] +input: | + [args] > foo + bar > i + ((text args).as-i as-bar.b).as-j >> [x] From 0971a90976b7883c038793a11d2a051583d35a9b Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 15:53:39 +0200 Subject: [PATCH 19/23] bug(#4559): redundant loop --- eo-parser/src/main/java/org/eolang/parser/XeEoListener.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index fd1725fdd5a..ca35c5be576 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1227,11 +1227,9 @@ private String alphaAttr(final ParserRuleContext ctx, final String msg) { */ private void startAutoPhiFormation(final ParserRuleContext ctx, final String application) { final Matcher matcher = XeEoListener.LAST_APPLICATION.matcher(application); - String abase; + final String abase; if (matcher.find()) { - do { - abase = String.format(".%s", matcher.group(1)); - } while (matcher.find()); + abase = String.format(".%s", matcher.group(1)); } else { abase = application; } From 82f1cb7f65cbcf8b4c3eb515a4fcc283ab41eaa7 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 15:53:52 +0200 Subject: [PATCH 20/23] bug(#4559): typo --- ...yaml => auto-phi-formation-from-application-with-hyphens.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename eo-parser/src/test/resources/org/eolang/parser/eo-syntax/{auto-phi-formation-from-application-with-hypens.yaml => auto-phi-formation-from-application-with-hyphens.yaml} (100%) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hyphens.yaml similarity index 100% rename from eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hypens.yaml rename to eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-application-with-hyphens.yaml From a67b94bfc2990911f624650c76a325cc7412e6d4 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 16:10:56 +0200 Subject: [PATCH 21/23] =?UTF-8?q?bug(#4559):=20add=20support=20for=20QQ=20?= =?UTF-8?q?prefix=20in=20EO=20applications=20to=20map=20to=20=CE=A6.org.eo?= =?UTF-8?q?lang?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/org/eolang/parser/XeEoListener.java | 4 +++- .../auto-phi-formation-from-qq-application.yaml | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-qq-application.yaml diff --git a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java index ca35c5be576..7eaf5e8367e 100644 --- a/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java +++ b/eo-parser/src/main/java/org/eolang/parser/XeEoListener.java @@ -1248,7 +1248,9 @@ private void startAutoPhiFormation(final ParserRuleContext ctx, final String app private static String eoApplicationToXmir(final String application) { final String transformed = application.replace("^.", "ρ."); final String base; - if (transformed.startsWith("Q.")) { + if (transformed.startsWith("QQ.")) { + base = transformed.replace("QQ", "Φ.org.eolang"); + } else if (transformed.startsWith("Q.")) { base = transformed.replace("Q.", "Φ."); } else { base = transformed; diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-qq-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-qq-application.yaml new file mode 100644 index 00000000000..f4997fef20d --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-qq-application.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[2][@name='x' and @base='∅' and not(@as)] and o[3][@name='φ' and @base='Φ.org.eolang.foo.bar']/o[1][@base='Φ.org.eolang.number']] +input: | + [] > main + start > @ + QQ.foo.bar 42 >> [x] From cfc1e1378a92ae8c8e355af8d1f4ef8d8e6527d7 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 19:57:56 +0200 Subject: [PATCH 22/23] bug(#4559): add test case for auto phi formation from nested application --- .../auto-phi-formation-from-nested-application.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml new file mode 100644 index 00000000000..71a5542995f --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml @@ -0,0 +1,12 @@ +# SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com +# SPDX-License-Identifier: MIT +--- +# yamllint disable rule:line-length +sheets: [] +asserts: + - /object[not(errors)] + - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='ρ.x.ρ.y.ρ.z']] +input: | + [args] > main + a > x1 + ^.x.^.y.^.z >> [y] From f384915cd9d8be4c76ce7157bc119ef8aaaad833 Mon Sep 17 00:00:00 2001 From: h1alexbel Date: Thu, 25 Sep 2025 19:58:44 +0200 Subject: [PATCH 23/23] bug(#4559): skip auto-phi formation test due to parsing issues with nested abstracts --- ...o-phi-formation-from-nested-application.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml index 71a5542995f..1a96b5df2b2 100644 --- a/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml +++ b/eo-parser/src/test/resources/org/eolang/parser/eo-syntax/auto-phi-formation-from-nested-application.yaml @@ -2,11 +2,20 @@ # SPDX-License-Identifier: MIT --- # yamllint disable rule:line-length +# @todo #4559:60min Enable the test after auto-phi formations under nested abstracts will be parsed +# correctly. For now, we just appending `ξ.ρ` to the application `@base`. We should not do this, +# instead, we keep it as `@base`, allowing XSL transformations resolve the scope correctly. This +# puzzle depends on this issue: https://github.com/objectionary/eo/issues/4557 +skip: true sheets: [] asserts: - /object[not(errors)] - - //o[not(@base) and @name='ap🌵34' and o[@name='φ' and @base='ρ.x.ρ.y.ρ.z']] + - //o[not(@base) and @name='ap🌵68' and o[@name='φ' and @base='ξ.ρ.ρ.ρ.ρ.x.some']] input: | - [args] > main - a > x1 - ^.x.^.y.^.z >> [y] + [] > foo + 5 > x + [] > bar + [] > baz + [] > bus + start > nested + x.some >> []