Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(#3481): no abstracts to global + fixed java generation #3813

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading