Skip to content

Commit

Permalink
Merge pull request #3813 from maxonfjvipon/bug/#3481/no-abstracts-to-…
Browse files Browse the repository at this point in the history
…global

bug(#3481): no abstracts to global + fixed java generation
  • Loading branch information
yegor256 authored Jan 14, 2025
2 parents 85c17ab + 318f2cf commit 4bfd957
Show file tree
Hide file tree
Showing 77 changed files with 434 additions and 1,668 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public final class DiscoverMojo extends SafeMojo {
" and @base != '^'",
" and @base != '$'",
" and @base != '∅'",
" and not(@ref)",
"]/@base"
);

Expand Down
12 changes: 2 additions & 10 deletions eo-maven-plugin/src/main/java/org/eolang/maven/TrShaking.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,15 @@ final class TrShaking extends TrEnvelope {
new TrFull(
new TrClasspath<>(
"/org/eolang/parser/shake/cti-adds-errors.xsl",
"/org/eolang/parser/shake/add-refs.xsl",
"/org/eolang/parser/shake/vars-float-up.xsl",
"/org/eolang/parser/shake/build-fqns.xsl",
"/org/eolang/parser/shake/expand-qqs.xsl",
"/org/eolang/parser/shake/add-probes.xsl",
"/org/eolang/parser/shake/vars-float-up.xsl",
"/org/eolang/parser/shake/expand-aliases.xsl",
"/org/eolang/parser/shake/resolve-aliases.xsl",
"/org/eolang/parser/shake/add-default-package.xsl",
"/org/eolang/parser/shake/explicit-data.xsl",
"/org/eolang/parser/shake/set-locators.xsl",
"/org/eolang/parser/shake/clean-up.xsl",
"/org/eolang/parser/shake/remove-refs.xsl",
"/org/eolang/parser/shake/abstracts-float-up.xsl",
"/org/eolang/parser/shake/remove-levels.xsl",
"/org/eolang/parser/shake/add-refs.xsl",
"/org/eolang/parser/shake/fix-missed-names.xsl",
"/org/eolang/parser/shake/add-refs.xsl",
"/org/eolang/parser/shake/set-locators.xsl",
"/org/eolang/parser/shake/blank-xsd-schema.xsl"
).back()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,9 @@ public final class TranspileMojo extends SafeMojo {
new TrJoined<>(
new TrClasspath<>(
"/org/eolang/maven/transpile/classes.xsl",
"/org/eolang/maven/transpile/package.xsl",
"/org/eolang/maven/transpile/tests.xsl",
"/org/eolang/maven/transpile/rename-tests-inners.xsl",
"/org/eolang/maven/transpile/align-test-classes.xsl",
"/org/eolang/maven/transpile/remove-high-level-inner-classes.xsl",
"/org/eolang/maven/transpile/anonymous-to-nested.xsl",
"/org/eolang/maven/transpile/package.xsl",
"/org/eolang/maven/transpile/attrs.xsl",
"/org/eolang/maven/transpile/data.xsl"
).back(),
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,15 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="remove-levels" version="2.0">
<!--
Here we remove @level attribute from all objects.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="anonymous-to-nested" version="2.0">
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="//o[o[@level]]">
<xsl:template match="class[descendant::o[not(@base) and not(@name) and o]]">
<xsl:copy>
<xsl:apply-templates select="node() except o[@level]|@*"/>
<xsl:for-each select="o[@level]">
<xsl:sort select="@level" data-type="number"/>
<xsl:variable name="o" select="."/>
<xsl:if test="not(preceding-sibling::o[@name=$o/@name or @as=$o/@as])">
<xsl:apply-templates select="."/>
</xsl:if>
<xsl:apply-templates select="node()|@*"/>
<xsl:for-each select=".//o[not(@base) and not(@name) and o]">
<xsl:element name="nested">
<xsl:apply-templates select="node()|@*"/>
</xsl:element>
</xsl:for-each>
</xsl:copy>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,48 @@ SOFTWARE.
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" id="attrs" version="2.0">
<xsl:output encoding="UTF-8" method="xml"/>
<xsl:template match="class[not(@base)]/o[@name and not(@level)]">
<xsl:template match="class[not(@base)]/o[@name]">
<xsl:apply-templates select="." mode="with-attributes"/>
</xsl:template>
<xsl:template match="o/o[@name]" mode="abstracts">
<xsl:apply-templates select="." mode="with-attributes"/>
</xsl:template>
<xsl:template match="nested/o">
<xsl:apply-templates select="." mode="with-attributes"/>
</xsl:template>
<xsl:template match="*" mode="with-attributes">
<xsl:element name="attr">
<xsl:apply-templates select="@name"/>
<xsl:variable name="t">
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="@base!='∅'">
<xsl:when test="@base and @base!='∅'">
<xsl:text>bound</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:when test="@base and @base='∅'">
<xsl:text>void</xsl:text>
</xsl:when>
<xsl:when test="@atom">
<xsl:text>atom</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>abstract</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:element name="{$t}">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:element>
<xsl:variable name="inner">
<xsl:element name="{$type}">
<xsl:if test="$type='abstract'">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="node()" mode="abstracts"/>
</xsl:if>
<xsl:if test="$type!='abstract'">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:if>
</xsl:element>
</xsl:variable>
<xsl:copy-of select="$inner"/>
</xsl:element>
</xsl:template>
<xsl:template match="node()|@*">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SOFTWARE.
<xsl:text>&gt;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template match="o[eo:abstract(.)]">
<xsl:template match="objects/o[eo:abstract(.)]">
<xsl:apply-templates select="." mode="class"/>
</xsl:template>
<xsl:template match="objects/o[@base and @name]">
Expand Down

This file was deleted.

This file was deleted.

Loading

4 comments on commit 4bfd957

@0pdd
Copy link

@0pdd 0pdd commented on 4bfd957 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1249-130f8649 disappeared from eo-maven-plugin/src/main/resources/org/eolang/maven/pre/align-test-classes.xsl), that's why I closed #3266. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link

@0pdd 0pdd commented on 4bfd957 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 1249-cbc24ee5 disappeared from eo-maven-plugin/src/main/resources/org/eolang/maven/pre/remove-high-level-inner-classes.xsl), that's why I closed #3267. Please, remember that the puzzle was not necessarily removed in this particular commit. Maybe it happened earlier, but we discovered this fact only now.

@0pdd
Copy link

@0pdd 0pdd commented on 4bfd957 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3481-02ddf8e7 discovered in eo-runtime/src/main/eo/org/eolang/txt/text.eo) and submitted as #3814. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

@0pdd
Copy link

@0pdd 0pdd commented on 4bfd957 Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 3481-e9fa64ec discovered in eo-runtime/src/test/java/org/eolang/XmirObjectTest.java) and submitted as #3815. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.