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

Various fixes for hexadecimal numbers in shaders #1345

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

msg-programs
Copy link
Contributor

@msg-programs msg-programs commented Feb 8, 2025

  • By selecting this checkbox, I agree to license my contributions to this project under the license(s) described in the LICENSE file, and I have the right to do so or have received permission to do so by an employer or client I am producing work for whom has this right.

Fixes the issues described in #1340:

  • F inside a hexadecimal number classified as identifier
  • f inside a hexadecimal number causes "float literals not implemented" error
  • e/E inside a hexadecimal number cause either "float literals not implemented" or "duplicate exponent" error

Also adds/changes some error messages:

  • Adds "hexadecimal exponent in decimal float" when finding p/P outside a number starting with 0x
  • Adds "incomplete exponent" when finding p/P/e/E at the end of a number literal
  • Clarifies "suffix '{c}' on float literal" --> "int suffix '{c}' on float literal"

The implementation seems a bit heavy-handed and I'm not 100% sure to have caught all edge cases despite testing, so I'm open for any feedback and changes.

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.

1 participant