-
Notifications
You must be signed in to change notification settings - Fork 177
bug(#4533): remove $ from syntax
#4604
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
base: master
Are you sure you want to change the base?
Changes from all commits
7dbc375
7dddc69
9c267b4
b0edbd7
066c37c
7cb723c
0236a7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,7 +49,7 @@ eo: | | |
| stdout > @ | ||
| sprintf | ||
| "%i" | ||
| $.other 1 > one | ||
| other 1 > one | ||
| memory 0 > price | ||
|
|
||
| # No comments. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,4 +40,4 @@ input: | | |
| 6.2 | ||
| [e] | ||
| e.hello > @ | ||
| $.^.^.p > q | ||
| ^.^.p > q | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,12 +51,6 @@ public String asString() { | |
| } else { | ||
| fqn = String.format("Φ.org.eolang.%s", name); | ||
| } | ||
| final String base; | ||
| if (this.context.XI() == null) { | ||
| base = fqn; | ||
| } else { | ||
| base = String.format("ξ.%s", fqn); | ||
| } | ||
| return base; | ||
| return fqn; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel It's better to leave xi in XMIR since it's IR for PHI expression also so it must be as full as possible
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxonfjvipon to me, it does not look correct to append Will be parsed as such: However, |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,4 +23,4 @@ input: | | |
| (scanner stdin).next-line > line! | ||
| (stdout "You entered" line).print | ||
| ^.x | ||
| $ | ||
| x.@ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -39,6 +39,6 @@ input: | | |
| (scanner stdin).next-line > line! | ||
| (stdout "You entered" line).print | ||
| ^.x | ||
| $ | ||
| and.@ | ||
| custom 5 | ||
| a | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| # SPDX-License-Identifier: MIT | ||
| --- | ||
| # yamllint disable rule:line-length | ||
| line: 2 | ||
| message: |- | ||
| [2:2] error: 'token recognition error at: '$'' | ||
| $.x > boom | ||
| [2:3] error: 'Invalid object declaration' | ||
| $.x > boom | ||
| ^ | ||
| input: | | ||
| [x] > foo | ||
| $.x > boom |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| # SPDX-License-Identifier: MIT | ||
| --- | ||
| # yamllint disable rule:line-length | ||
| line: 2 | ||
| message: |- | ||
| [2:2] error: 'token recognition error at: '$'' | ||
| $ > as-foo | ||
| [2:3] error: 'Invalid object declaration' | ||
| $ > as-foo | ||
| ^ | ||
| input: | | ||
| [] > foo | ||
| $ > as-foo |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -600,7 +600,7 @@ | |
| "C:" | ||
|
|
||
| # Tests that Windows path normalization replaces forward slashes with backslashes. | ||
| [] +> tests-normalizes-win32-path-with-replacing-slashes | ||
| [] > tests-normalizes-win32-path-with-replacing-slashes | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel I think it's not a good way to disable test.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxonfjvipon I've created
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel I saw, but disabling tests by replacing
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxonfjvipon should I comment them then? P.S. #4228 to be implemented.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel just make them decorate |
||
| eq. > @ | ||
| (path.win32 "/var/www/../html/").normalized | ||
| "\\var\\html\\" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,7 +60,7 @@ | |
|
|
||
| # Creates a `matcher` that will match the given input against the pattern. | ||
| [txt] > match | ||
| (matched-from-index 1 0).matched > next | ||
| matched-from-index 1 0 > next | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel let's use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxonfjvipon it does not work here: Seems that it happens due to idempotency attribute
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel it must be available because this attribute is added before converting to Java
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @maxonfjvipon the attribute <xsl:if test="not(bound/o[eo:idempotent(.)])">
<xsl:variable name="name" select="eo:attr-name(@name, false())"/>
<xsl:if test="not(@name)">
<xsl:message terminate="yes">
<xsl:text>Unnamed attribute found in </xsl:text>
<xsl:value-of select="parent::*/@loc"/>
</xsl:message>
</xsl:if>
<xsl:if test="not(contains($name, '+'))">
<xsl:value-of select="eo:eol($indent)"/>
<xsl:if test="$context!='this'">
<xsl:text>((PhDefault) </xsl:text>
</xsl:if>
<xsl:value-of select="$context"/>
<xsl:if test="$context!='this'">
<xsl:text>)</xsl:text>
</xsl:if>
<xsl:text>.add("</xsl:text>
<xsl:value-of select="$name"/>
<xsl:text>", </xsl:text>
<xsl:apply-templates select="void|bound|atom|abstract">
<xsl:with-param name="indent" select="$indent"/>
<xsl:with-param name="name" select="$name"/>
<xsl:with-param name="parent" select="$parent"/>
<xsl:with-param name="context" select="$context"/>
</xsl:apply-templates>
<xsl:text>);</xsl:text>
</xsl:if>
</xsl:if>If we remove this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @h1alexbel why do we get troubles? We put only void attributes which must be upper than any other attributes. This xi is already bound so I don't see any troubles |
||
|
|
||
| # Get `position`-th block matched from `start` position. | ||
| # If string subsequence is found - returns `org.eolang.txt.regex.pattern.match.matched` | ||
|
|
@@ -85,21 +85,23 @@ | |
| # - `next` - to get next matched block | ||
| # - `text` - to get matched subsequence as `string` | ||
| # - `group {index}` - to get string subsequence captured by `index`-th group. | ||
| # @todo #4411:35min Replace all left usages of `$ > oname`. | ||
| # We should remove all the usages like `$ > matched` from the syntax, and | ||
| # from the runtime objects. Currently, it is not possible because syntax sugar for object | ||
| # idempotency is not fully implemented, and we cannot remove some edge case usages, like | ||
| # here, in `matched`. Don't forget to remove this puzzle. | ||
| # @todo #4533:60min Enable disabled tests with regexes. | ||
| # Currently we disabled the following 7 tests: `tests-sanitizes-windows-path-with-regex`, | ||
| # `tests-replaces-windows-path-with-slash`, `tests-replaces-digits-with-string`, | ||
| # `tests-regex-contains-valid-groups-on-each-matched-block`, | ||
| # `tests-replaces-slashes-to-windows-separator`, | ||
| # `tests-regex-returns-valid-second-matched-block`, | ||
| # `tests-normalizes-win32-path-with-replacing-slashes`, `tests-walks-recursively`, | ||
| # since idempotency attribute `xi🌵` is not available in runtime for Phi.take("xi🌵"). | ||
| # We need to correctly model it in runtime first, then enable tests. | ||
| [position start from to groups] > matched | ||
| $ > matched | ||
| groups.length > groups-count | ||
| start.gte 0 > exists | ||
| if. > next | ||
| if. > next' | ||
| exists | ||
| matched. | ||
| matched-from-index | ||
| position.plus 1 | ||
| to | ||
| matched-from-index | ||
| position.plus 1 | ||
| to | ||
| error "Matched block does not exist, can't get next" | ||
h1alexbel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if. > text | ||
| exists | ||
|
|
@@ -142,7 +144,7 @@ | |
| ((regex "/[a-z]+/").match "!hello!").next.text.eq "hello" > @ | ||
|
|
||
| # Tests that regex can find multiple matches with correct positions and text. | ||
| [] +> tests-regex-returns-valid-second-matched-block | ||
| [] > tests-regex-returns-valid-second-matched-block | ||
| and. > @ | ||
| and. | ||
| and. | ||
|
|
@@ -251,7 +253,7 @@ | |
| (regex "(.)+").compiled > @ | ||
|
|
||
| # Tests that regex with capturing groups returns correct group count and content. | ||
| [] +> tests-regex-contains-valid-groups-on-each-matched-block | ||
| [] > tests-regex-contains-valid-groups-on-each-matched-block | ||
| and. > @ | ||
| and. | ||
| and. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.