-
-
Notifications
You must be signed in to change notification settings - Fork 175
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
[Feature removal request] Disallow tokens after numbers without separation #987
Comments
When or if we add a feature involving letters following numbers, we can just change how lexing works then, and have users add spaces. If we never do so, there's no need to change it. That said, when I get back to #958 and add |
It's a breaking change (as @ISSOtm raised on Saturday), and thus it should have an explicit deprecation/removal unless we know nobody is using it. |
It's a breaking change on the same level as introducing a Anyway, whether or not we add a deprecation step, should |
There's no need to extend numeric syntax right now, so this change is unnecessary. We can deprecate when the needs arise, but I don't see any downsides with the current situation. |
It should lex as a number (and then fail, like |
Big-name C compilers have special handling for these sort of inputs, but others act like rgbasm does, lexing two separate tokens and then getting a parse error. Input: int x = 123abc;
int y = 12.34pq;
int z = 12.34.56; gcc handles it specially:
SDCC works like RGBASM:
I think having the GB assembler and the GB C compiler behave similarly here is fine. |
After the long discussion the other way about whether something like
123abc
should be valid or not, the issue right now is that it's impossible to safely implement any feature that extends numeric syntax in any way, because123abc
parses as123
followed byabc
.This is also confusing (unexpected by virtually everyone), almost certainly bug-inducing (consider operator precedence issues), and used by virtually nobody (only one use case found in our brief research, which could be equally or better served by separating the suffix from the number with a space, and would definitely be better served by user-defined functions).
While the space for expansion in terms of number syntax is large, and we could probably have a long debate about what's useful and what's not, all of that is blocked by this syntax.
Therefore, my request is that this parsing becomes deprecated in 0.5.x and removed in 0.6.0. That way we can begin talking about any features using this space after 0.6.0 comes out someday.
The text was updated successfully, but these errors were encountered: