Add tokens for signed/unsigned 128bit integer values.#4566
Add tokens for signed/unsigned 128bit integer values.#4566yebblies merged 1 commit intodlang:masterfrom
Conversation
Add the tokens to the token list and adds them to the parser where needed. Does not add a lexer for these values - they are unused. See ldc-developers/ldc#891 for the use case.
|
Do you know if we can just have a single token type for integer literals? Or possibly just a signed and an unsigned? |
|
What's the plan for parser support and the rest of frontend integration? Something like complex_t? |
|
Depending on the value of the literal and the postfix flags ( |
|
Oh yeah, I forgot about the postfixes. I guess it could be done like string literals, with flags for those things. |
|
Auto-merge toggled on |
Add tokens for signed/unsigned 128bit integer values.
|
My plan is to integrate the support in the frontend. My ldc pull mostly changes frontend code. |
|
Yes, I'm only asking about the frontend. ctfe will need 128-bit integer support, like complex_t is currently used (and longdouble). |
|
I'd wait until ddmd to land first before 128bit CTFE support. Better to leverage std.bigint rather than invent a new synthetic type for N-bit integer support. |
|
Heh we'll see. 128-bit ints are a lot simpler than full bigint, and the complications using phobos brings. |
|
I currently take advantage of GCC's |
|
@yebblies, you have two choices really.
The same should really be done with real/double/float also. (OT, but I found that when talking to developers, they care more about consistent results in CTFE, not accurate when it comes to floating point). |
|
Choice 1 sounds sufficient and preferable! One of the big annoyances is going to be that D doesn't have implicit struct construction, so there are 1000s of places in the frontend that will need an explicit constructor call. |
|
We do the same with |
|
I know, it's just annoying. :( |
Maybe we should start writing one and see? I've started one, now fill in the gaps. ;) |
|
It's a bit incomplete, no? |
Add the tokens to the token list and adds them to the parser where needed.
Does not add a lexer for these values - they are unused.
See ldc-developers/ldc#891 for the use case.