-
Notifications
You must be signed in to change notification settings - Fork 207
bug(#3999): change @star resolving implementation
#4002
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
Merged
yegor256
merged 9 commits into
objectionary:master
from
maxonfjvipon:bug/#3999/recursive-tuple
Mar 14, 2025
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a800acf
bug(#3999): hexing
maxonfjvipon c931c76
bug(#3999): parser
maxonfjvipon 8ba70f8
bug(#3999): runtime
maxonfjvipon c2910f2
bug(#3999): stars
maxonfjvipon a78ed1e
bug(#3999): success
maxonfjvipon f504b54
bug(#3999): todo
maxonfjvipon 9c4b33e
bug(#3999): timeout
maxonfjvipon 625d04e
bug(#3999): qulice
maxonfjvipon cc39c17
bug(#3999): typo
maxonfjvipon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
| package org.eolang.parser; | ||
|
|
||
| import com.yegor256.xsline.Shift; | ||
| import com.yegor256.xsline.StEnvelope; | ||
| import java.nio.ByteBuffer; | ||
| import org.w3c.dom.Element; | ||
| import org.w3c.dom.Node; | ||
|
|
||
| /** | ||
| * This {@link Shift} turns regular data (numbers) inside XMIR. | ||
| * into hexadecimal representation. | ||
| * | ||
| * @since 0.54 | ||
| */ | ||
| final class StHex extends StEnvelope { | ||
| /** | ||
| * Ctor. | ||
| */ | ||
| StHex() { | ||
| super( | ||
| new StXnav( | ||
| "st-hex", | ||
| "//o[@hex]", | ||
| xnav -> { | ||
| final Node node = xnav.node(); | ||
| node.setTextContent( | ||
| new BytesToHex( | ||
| ByteBuffer | ||
| .allocate(Double.BYTES) | ||
| .putDouble(Double.parseDouble(xnav.text().orElseThrow())) | ||
| .array() | ||
| ).get() | ||
| ); | ||
| ((Element) node).removeAttribute("hex"); | ||
| } | ||
| ) | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| /* | ||
| * SPDX-FileCopyrightText: Copyright (c) 2016-2025 Objectionary.com | ||
| * SPDX-License-Identifier: MIT | ||
| */ | ||
| package org.eolang.parser; | ||
|
|
||
| import com.jcabi.matchers.XhtmlMatchers; | ||
| import com.jcabi.xml.XMLDocument; | ||
| import com.yegor256.xsline.Xsline; | ||
| import org.hamcrest.MatcherAssert; | ||
| import org.hamcrest.Matchers; | ||
| import org.junit.jupiter.params.ParameterizedTest; | ||
| import org.junit.jupiter.params.provider.CsvSource; | ||
|
|
||
| /** | ||
| * Test case for {@link StHex}. | ||
| * | ||
| * @since 0.54.0 | ||
| */ | ||
| final class StHexTest { | ||
| @ParameterizedTest | ||
| @CsvSource({ | ||
| "1, 3F-F0-00-00-00-00-00-00", | ||
| "2, 40-00-00-00-00-00-00-00", | ||
| "3, 40-08-00-00-00-00-00-00", | ||
| "10, 40-24-00-00-00-00-00-00" | ||
| }) | ||
| void convertsNumberToHex(final String number, final String bytes) { | ||
| MatcherAssert.assertThat( | ||
| String.format( | ||
| "StHex must convert number '%s' to '%s' bytes and remove @hex attribute", | ||
| number, bytes | ||
| ), | ||
| new Xsline(new StHex()).pass( | ||
| new XMLDocument( | ||
| String.format( | ||
| "<p><o base='Q.org.eolang.number'><o base='Q.org.eolang.bytes' hex=''>%s</o></o></p>", | ||
| number | ||
| ) | ||
| ) | ||
| ), | ||
| Matchers.allOf( | ||
| XhtmlMatchers.hasXPath(String.format("//o[text()='%s']", bytes)), | ||
| XhtmlMatchers.hasXPath("/p[not(//o[@hex])]") | ||
| ) | ||
| ); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.