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

Add integer literals with bases #2746

Merged
merged 5 commits into from
Apr 22, 2024

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Apr 19, 2024

Allow integer literals to be expressed in different bases:

  1. binary, with prefix 0b.
  2. octal, with prefix 0o.
  3. decimal, with no prefix.
  4. hexadecimal, with prefix 0x. Both capital and lower case letters are parsed. They are always printed as lower case letters.

This applies to all languages that use integer literals, but only in the concrete language the base will be preserved when pretty printing.

@janmasrovira janmasrovira added enhancement New feature or request syntax labels Apr 19, 2024
@janmasrovira janmasrovira self-assigned this Apr 19, 2024
@janmasrovira janmasrovira linked an issue Apr 19, 2024 that may be closed by this pull request
@janmasrovira janmasrovira marked this pull request as ready for review April 19, 2024 16:23
@lukaszcz lukaszcz force-pushed the 2735-allow-hexadecimal-numeric-constants branch from 8f63e35 to 68ed58b Compare April 22, 2024 09:22
@lukaszcz lukaszcz self-requested a review April 22, 2024 09:22
@paulcadman paulcadman force-pushed the 2735-allow-hexadecimal-numeric-constants branch from 68ed58b to 9ed21b1 Compare April 22, 2024 10:09
@paulcadman paulcadman added this to the 0.6.2 milestone Apr 22, 2024
@paulcadman paulcadman force-pushed the 2735-allow-hexadecimal-numeric-constants branch from 9ed21b1 to cabd6f9 Compare April 22, 2024 12:28
@janmasrovira janmasrovira merged commit 8497c29 into main Apr 22, 2024
4 checks passed
@janmasrovira janmasrovira deleted the 2735-allow-hexadecimal-numeric-constants branch April 22, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request syntax
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow hexadecimal numeric constants
3 participants