Skip to content
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

Fix cidentlist handling of single quotes in hex literals #300

Merged
merged 2 commits into from
Dec 22, 2024

Conversation

KangarooKoala
Copy link
Contributor

Fixes #299.

Also removes the digit regex and instead directly checks the character (if any) before the single quote. This should work as long as the input is syntactically valid, since 0' or a' should only be syntactically valid inside a numeric literal.

Also, I'm not sure whether applying De Morgan's Laws to the condition in the token == "'" branch would help or hurt readability.

Also rework numeric literal handling in general
wpiformat/wpiformat/cidentlist.py Outdated Show resolved Hide resolved
@calcmogul calcmogul merged commit 5a5c5cb into wpilibsuite:main Dec 22, 2024
15 checks passed
@KangarooKoala KangarooKoala deleted the hex-digit-separator branch December 22, 2024 01:41
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.

Integer literal separator after non-numeric hex digit breaks CIdentList step
2 participants