Skip to content

#7976: name the conversion by its letter, not by its byte - #8015

Merged
yegor256 merged 1 commit into
masterfrom
7976
Aug 31, 2026
Merged

#7976: name the conversion by its letter, not by its byte#8015
yegor256 merged 1 commit into
masterfrom
7976

Conversation

@yegor256

Copy link
Copy Markdown
Member

Closes #7976.

Two messages in string/printf.eo formatted the conversion with %x over its bytes, so the user was shown the hexadecimal value of the byte instead of the letter they wrote:

call before after
"%o".printf (* "x") The conversion 6F in the format is unsupported, … The conversion o in the format is unsupported, …
"%0s".printf (* "x") The zero flag can't be applied to the 73 conversion, … The zero flag can't be applied to the s conversion, …

string conv is safe at both points: digits-end walks the specifier through code, which is as-ascii. string (byte i), so a byte that does not decode on its own has already terminated the run before either message can be raised.

The two --> stops-on-… tests keep covering the terminations. The texts themselves cannot be pinned from EO — printf has no fallback attribute and recovered hands back its alternative, not the reason — so nothing in the file can read a message back.

TestEOstring is green (418 tests) on a local mvn clean test -pl :eo-runtime -Deo.deadline=3600.

Touches the same if chain as #7985 (PR #8014), so whichever lands second will want a rebase.


Generated by Claude Code

Two messages formatted the conversion with %x over its bytes, so a user
who wrote %o was told "The conversion 6F in the format is unsupported"
and one who wrote %0s was told about "the 73 conversion". The byte is a
single ASCII one by the time either message is raised, since the digit
scan already read it back as text, so `string conv` names what the user
wrote.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NxFBB1HWHS1xgdM6bT9Qvw
@sonarqubecloud

Copy link
Copy Markdown

@yegor256
yegor256 marked this pull request as ready for review August 31, 2026 08:36
Copilot AI lite review requested due to automatic review settings August 31, 2026 08:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yegor256
yegor256 merged commit 4df5cc3 into master Aug 31, 2026
24 checks passed
@yegor256
yegor256 deleted the 7976 branch August 31, 2026 13:11
@0crat

0crat commented Sep 3, 2026

Copy link
Copy Markdown

@yegor256 Thanks for the contribution! You've earned +4 points for this: +16 as a basis; -8 for the lack of code review; -4 for too few (8) hits-of-code. Please, keep them coming. Your running score is +1694; don't forget to check your Zerocracy account too).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

string.printf names the conversion by its hexadecimal byte in two error messages

4 participants