-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
make numeric literal juxtaposition less brittle #15731
Comments
I think I would generally be in favor of deprecating float literals with trailing |
This is a pretty simple change and we would benefit from doing it sooner rather than later. |
Bump – @JeffBezanson, could you do this? |
Number parsing changes are never simple :) Working on this. First interesting issue I hit is |
Ah, that's an interesting one. |
Maybe a better option to disallowing |
How about allowing |
@omus: Unfortunately, using the lowercase form is by far more common and also looks better. |
@StefanKarpinski I agree that forcing uppercase letters looks worse. I like your suggestion but unfortunately the non-digit following a digit heuristic means that Could we not just try to parse |
smacks forehead |
Honestly, disallowing float literals with a trailing |
I agree. Shall we merge #16339? |
Was #16339 the biggest part of this that we wanted to do prior to 0.5? For the rest should we remove the milestone? |
It doesn't seem worthwhile to me to disallow juxtaposing |
The most obvious two changes would be:
0
as a juxtaposed numeric literal coefficient:0n
would be a syntax error..
:1.x
would be a syntax error.There may be others but these two strike me as clearly a good idea. One nice thing about disallowing
0
as a juxtaposed numeric literal coefficient is that it opens up as many0x1234
syntaxes as one might ever want, so it kind of future-proofs us for that. Another nice thing is that instead of getting a surprise when they try0x
after0y
just working, people will get a warning as soon as they try0y
and they can immediately learn that0
doesn't work as a juxtaposed numeric literal coefficient.The text was updated successfully, but these errors were encountered: