Skip to content

refactor: token parsing with explicit outcome enums - #383

Merged
DeveloperC286 merged 3 commits into
mainfrom
claude/integer-literal-range-error-dpckmh
Sep 5, 2026
Merged

refactor: token parsing with explicit outcome enums#383
DeveloperC286 merged 3 commits into
mainfrom
claude/integer-literal-range-error-dpckmh

Conversation

@DeveloperC286

@DeveloperC286 DeveloperC286 commented Sep 5, 2026

Copy link
Copy Markdown
Owner

No description provided.

@DeveloperC286 DeveloperC286 changed the title Refactor token parsing with explicit outcome enums refactor: token parsing with explicit outcome enums Sep 5, 2026
parse_integer returned None on overflow with no distinction from other
unparsable input, so a literal like 99999999999999999999 surfaced the
generic "Unparsable context" message instead of explaining that it
doesn't fit in a signed 64 bit integer.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjJMbX5dSjVuZWXBEuZwKS
parse_integer now returns a ParsedInteger enum so the overflow case is
known for certain from ParseIntError::kind() rather than inferred by
checking whether the unparsable context happens to be all digits.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjJMbX5dSjVuZWXBEuZwKS
ParsedInteger becomes IntegerParseOutcome for clarity. parse_keyword
and parse_identifier are merged into a single parse_identifier that
returns IdentifierParseOutcome (Keyword/Identifier/NotAnIdentifier),
moving the keyword-takes-precedence rule into that one function
instead of the parse_context match tuple.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DjJMbX5dSjVuZWXBEuZwKS
@DeveloperC286
DeveloperC286 force-pushed the claude/integer-literal-range-error-dpckmh branch from e7ef52d to 297e402 Compare September 5, 2026 10:51
@DeveloperC286
DeveloperC286 merged commit c0c4082 into main Sep 5, 2026
23 checks passed
@DeveloperC286
DeveloperC286 deleted the claude/integer-literal-range-error-dpckmh branch September 5, 2026 10:53
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.

2 participants