Repository navigation
Conversation
A comparison took the integer path only when both operands parsed into an i128; a valid integer too large for it fell back to a string comparison, so 2^127 > 2 was false and 0B = B was false for a 42-digit B. POSIX compares two integers as decimal integers, so operands that satisfy the integer production are now compared by their value from their digits, whatever their size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every pattern regcomp refused was reported as just "invalid regex", the
evaluator's errors being fixed strings. They are now Strings, and the
error carries plib's text with regcomp's reason, as in "invalid regex
'\(': Unmatched ( or \(".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Syntax errors said only "unexpected operator", "unexpected trailing argument" or "expected ')'". They now name the argument, as in "unexpected argument '3'" or "expected ')' but found '2'", and a group left open at the end says "missing ')'". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
is_integer_text, the integer comparison and its sign handling each read the production their own way, and the comparison copied both operands' digits into new vectors. integer_parts now gives the sign and digits of an integer operand to both, and the comparison works on the slices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
expr's integers are i128, wider than the signed long XCU 1.1.2.1 names, with "integer out of range" past that; comparisons work at any size. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The expr entry said a result beyond the 128-bit range is reported as "integer out of range"; that is the message for an operand, and a result gives "integer overflow". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
integer_value checked the production and then parsed the text again with Rust's i128 parser, a second idea of an integer, behind an unreachable UTF-8 error. It now accumulates the value from the sign and digits integer_parts gives, with checked arithmetic, and is_integer_text, left unused, is gone. A test now pins the message for a result that overflows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
token_text, which names an operator in a diagnostic, repeated parse_token's table of operators in reverse, two lists to keep in step. Both now use one table. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Syntax errors quote the offending argument, which came out raw: an escape sequence in it reached the terminal, and bytes that are not UTF-8 became U+FFFD, misquoting it. Control characters and such bytes are now written as \xHH. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every control character is below U+0100, so the branch that escaped
one beyond it as \u{...} could never run.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The escaping of an argument named in a diagnostic wrote a C1 control, two bytes in UTF-8, as one \xHH, which reads as a different argument; left a literal backslash alone, so a typed "\x1b" looked like an escaped ESC; let bidi overrides and other format characters through to reorder the terminal's line; and showed non-ASCII characters raw in any locale, so in the C locale a byte such as 0x9B could still act as a control. Now a backslash is doubled, every byte of a control, format character or invalid sequence is written as \xHH, and other non-ASCII characters are written as themselves only in a UTF-8 locale. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.