From 036cdccf9d4f995283a58bba4c6c91529e2ae129 Mon Sep 17 00:00:00 2001 From: maxonfjvipon Date: Fri, 15 Mar 2024 16:09:40 +0300 Subject: [PATCH] fix(#2952): fixed convertation to EO with child abstract --- .../org/eolang/maven/phi/same-name-inner.yaml | 35 +++++++++++++++ .../eolang/maven/unphi/long-names-inner.yaml | 23 ++++++++++ .../resources/org/eolang/parser/_funcs.xsl | 2 +- .../parser/samples/same-name-inners.yaml | 44 +++++++++++++++++++ 4 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/phi/same-name-inner.yaml create mode 100644 eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/long-names-inner.yaml create mode 100644 eo-parser/src/test/resources/org/eolang/parser/samples/same-name-inners.yaml diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/same-name-inner.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/same-name-inner.yaml new file mode 100644 index 0000000000..bf84aab8b2 --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/phi/same-name-inner.yaml @@ -0,0 +1,35 @@ +eo: | + # Test. + [] > compiles-correctly-with-long-duplicate-names + # Long object 1. + [] > long-object-name + # Long object 2. + [] > long-object-name + # Long object 3. + [] > long-object-name + # Long object 4. + [] > long-object-name + # Long object 5. + [] > long-object-name + TRUE > @ +phi: | + { + ⟦ + compiles-correctly-with-long-duplicate-names ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦⟧ + ⟧ + ⟧ + ⟧ + ⟧, + φ ↦ Φ.org.eolang.bool( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 01- + ) + ) + ⟧ + ⟧ + } \ No newline at end of file diff --git a/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/long-names-inner.yaml b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/long-names-inner.yaml new file mode 100644 index 0000000000..12131095ad --- /dev/null +++ b/eo-maven-plugin/src/test/resources/org/eolang/maven/unphi/long-names-inner.yaml @@ -0,0 +1,23 @@ +tests: + - //o[@abstract and @name='long-object-name' and o[@abstract and @name='long-object-name' and o[@abstract and @name='long-object-name' and o[@abstract and @name='long-object-name' and o[@abstract and @name='long-object-name']]]]] +phi: | + { + ⟦ + compiles-correctly-with-long-duplicate-names ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦ + long-object-name ↦ ⟦⟧ + ⟧ + ⟧ + ⟧ + ⟧, + φ ↦ Φ.org.eolang.bool( + α0 ↦ Φ.org.eolang.bytes( + Δ ⤍ 01- + ) + ) + ⟧ + ⟧ + } \ No newline at end of file diff --git a/eo-parser/src/main/resources/org/eolang/parser/_funcs.xsl b/eo-parser/src/main/resources/org/eolang/parser/_funcs.xsl index 7efc7b9974..4c47deee17 100644 --- a/eo-parser/src/main/resources/org/eolang/parser/_funcs.xsl +++ b/eo-parser/src/main/resources/org/eolang/parser/_funcs.xsl @@ -29,7 +29,7 @@ SOFTWARE. - + diff --git a/eo-parser/src/test/resources/org/eolang/parser/samples/same-name-inners.yaml b/eo-parser/src/test/resources/org/eolang/parser/samples/same-name-inners.yaml new file mode 100644 index 0000000000..222b75f26d --- /dev/null +++ b/eo-parser/src/test/resources/org/eolang/parser/samples/same-name-inners.yaml @@ -0,0 +1,44 @@ +origin: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > compiles-correctly-with-long-duplicate-names + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + TRUE > @ + +straight: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > compiles-correctly-with-long-duplicate-names + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + TRUE > @ + +reversed: | + # This is the default 64+ symbols comment in front of named abstract object. + [] > compiles-correctly-with-long-duplicate-names + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + # This is the default 64+ symbols comment in front of named abstract object. + [] > long-object-name + TRUE > @