Skip to content

Commit

Permalink
Merge branch '__rultor'
Browse files Browse the repository at this point in the history
  • Loading branch information
rultor committed Apr 12, 2024
2 parents db8f264 + a5d2e2d commit b842000
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ SOFTWARE.
<xsl:value-of select="eo:comma(2, $tabs+1)"/>
</xsl:if>
</xsl:if>
<!-- Empty delta binding in org.eolang.bytes -->
<xsl:if test="$package=concat($program, '.', 'org.eolang') and $name='bytes'">
<xsl:value-of select="$delta"/>
<xsl:value-of select="$dashed-arrow"/>
<xsl:value-of select="$empty"/>
<xsl:value-of select="eo:comma(2, $tabs+1)"/>
</xsl:if>
<!-- Inner objects -->
<xsl:for-each select="o">
<xsl:value-of select="eo:comma(position(), $tabs+1)"/>
<xsl:apply-templates select=".">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ phi: |
org ↦ ⟦
eolang ↦ ⟦
bytes ↦ ⟦
Δ ⤍ ∅,
eq ↦ ⟦
λ ⤍ Lorg_eolang_bytes_eq,
x ↦ ∅
Expand Down
31 changes: 18 additions & 13 deletions eo-parser/src/main/java/org/eolang/parser/XePhiListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,20 +289,25 @@ public void exitEmptyBinding(final PhiParser.EmptyBindingContext ctx) {
@Override
public void enterDeltaBinding(final PhiParser.DeltaBindingContext ctx) {
if (ctx.EMPTY() != null) {
throw new ParsingException(
"It's impossible to represent Δ ⤍ ∅ binding in EO",
new IllegalStateException(),
ctx.getStart().getLine()
);
}
this.objects()
.start()
.prop("data", "bytes")
.prop("base", "org.eolang.bytes");
if (!"--".equals(ctx.BYTES().getText())) {
this.objects().data(ctx.BYTES().getText().replaceAll("-", " ").trim());
if (!"org.eolang".equals(String.join(".", this.packages))
&& !"bytes".equals(this.attributes.peek())
) {
throw new ParsingException(
"It's impossible to represent Δ ⤍ ∅ binding in EO",
new IllegalStateException(),
ctx.getStart().getLine()
);
}
} else {
this.objects()
.start()
.prop("data", "bytes")
.prop("base", "org.eolang.bytes");
if (!"--".equals(ctx.BYTES().getText())) {
this.objects().data(ctx.BYTES().getText().replaceAll("-", " ").trim());
}
this.objects().leave();
}
this.objects().leave();
}

@Override
Expand Down

0 comments on commit b842000

Please sign in to comment.