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 literal base #3014

Merged
merged 1 commit into from
Jun 10, 2019
Merged

Add literal base #3014

merged 1 commit into from
Jun 10, 2019

Conversation

Egor18
Copy link
Contributor

@Egor18 Egor18 commented Jun 8, 2019

fix #2396

This PR adds base (2, 8, 10 or 16) to the numeric CtLiterals. Pretty printer will also output literals according to their base.
Note: I'd like to set the return value of getBase() to Optional<LiteralBase> instead of nullable LiteralBase, but the API test does not like it since it wants to see the actual getter. I can fix it if you want because I think that Optional makes more sense here since only numeric literals can have a base and having null for other literals is a bit unintuitive.

@monperrus
Copy link
Collaborator

Well done, esp. since you had to understand all the internals when adding a new role :-)

LGTM, ok to merge.

@nharrand nharrand merged commit 162a32b into INRIA:master Jun 10, 2019
@Egor18 Egor18 deleted the addLiteralBase branch June 15, 2019 19:34
@monperrus monperrus mentioned this pull request Jul 25, 2019
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.

feature: add support for verbatim number literals
3 participants