Various fixes for hexadecimal numbers in shaders #1345

Open
msg-programs wants to merge 4 commits from msg-programs/the-eff-number into main
msg-programs commented 2025-02-08 11:01:48 +00:00 (Migrated from github.com)
  • 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.

- [x] 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.
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin msg-programs/the-eff-number:msg-programs/the-eff-number
git switch msg-programs/the-eff-number

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff msg-programs/the-eff-number
git switch msg-programs/the-eff-number
git rebase main
git switch main
git merge --ff-only msg-programs/the-eff-number
git switch msg-programs/the-eff-number
git rebase main
git switch main
git merge --no-ff msg-programs/the-eff-number
git switch main
git merge --squash msg-programs/the-eff-number
git switch main
git merge --ff-only msg-programs/the-eff-number
git switch main
git merge msg-programs/the-eff-number
git push origin main
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach!1345
No description provided.