-
Notifications
You must be signed in to change notification settings - Fork 182
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
Allow hexadecimal/octal/binary numeric literals #333
Comments
Thanks for the issue @Y-Nak, we definitely want this.
Normalizing might be at odds with Yul readability. I'm not sure if this should be a deal breaker, though. From the docs: "Programs written in Yul should be readable, even if the code is generated by a compiler from Solidity or another high-level language." |
Yul supports hex, so I'm wondering if we want retain that representation in the Yul contracts, since certain expressions are easier to read with a given representation. As far as octal and binary go, we would definitely want to normalize that to hex in the lowering pass. |
@g-r-a-n-t Thanks for your advice, it sounds really reasonable! Can I implement this in line with your suggestion? |
That would be great 🙂. We just need to wait for #338 to get merged before this can be fully implemented, but that should be all. |
The simplest way to implement this would be adding the representation kind to AST in parsing pass, so I'd like to wait for #346. |
What is wrong?
Currently, the analyzer doesn't allow numeric literal representation other than decimal. This is inconsistent with both Rust and Python specifications.
How can it be fixed
analyzer
.Yul
, I think this would be done in lowering pass.The text was updated successfully, but these errors were encountered: