{{ message }}
Repository navigation
fix(tokenizer): reject overflowing hexadecimal and binary literals - #1087
Merged
Merged
Conversation
Apply the existing finite-number requirement to hexadecimal and binary literals, including negative values. Cover syntax diagnostics and source locations while preserving finite integer values. Fixes 8f4e#1049 Assisted-by: Codex
andorthehood
approved these changes
Oct 18, 2026
irimias57
approved these changes
Oct 18, 2026
irimias57
left a comment
Member
There was a problem hiding this comment.
Thank you for another excellent contribution, Nigel! By rejecting overflowing hexadecimal and binary literals instead of allowing them to be silently compiled as a different value, this makes 8f4e programs safer and compiler diagnostics much more trustworthy. The focused implementation and thorough tokenizer coverage look great.
Member
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.

Fixes #1049. Hexadecimal and binary literals that overflow to infinity now raise the same syntax diagnostic as overflowing decimal literals.
Added 14 regression/control cases covering both signs, source line diagnostics and finite values above 32 bits.
Validation on Node 24.16.0:
npx nx run @8f4e/tokenizer:test --output-style=static- 452 passed.npx nx run @8f4e/compiler:test --output-style=static- 323 passed.