-
-
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
Syntax issues with hexadecimal prefix #16356
Comments
My favorite part is that the syntax coloring in github gets it exactly right :P |
Syntax highlighting makes it obvious what is going on. In the REPL however it isn't very clear. |
The solution is clear: Add syntax highlighting to the REPL. |
I agree that adding syntax highlighting to the REPL would be great and would solve this issue. For this issue however I slightly lean towards disallowing juxtaposed hexadecimals as it avoids any potential confusion when syntax highlighting is unavailable. |
+1 to disallowing juxtaposed hexadecimals. I see no mathematical precedent
for that, and it seems highly confusing that the matter of where the
literal ends and the next symbol begins depends on which is the first
character after f in the alphabet.
|
If we're disallowing juxtaposed hexadecimals we probably also want to do the same for binary and octals
|
Looks like the syntax highlighting isn't quite right for the second last example. I believe it should highlight julia> 0x
ERROR: syntax: invalid numeric constant "0x"
julia> 0xg
ERROR: syntax: invalid numeric constant "0x"
julia> g = 1
1
julia> 0xg
ERROR: syntax: invalid numeric constant "0x"
julia> xg = 1
1
julia> 0xg
ERROR: syntax: invalid numeric constant "0x" |
fix #16356, deprecate juxtaposing hex literals
I was messing around with how the syntax for the hexadecimal prefix works while thinking about #15731 and I found something entertaining:
Maybe we should disallow juxtaposition with hexadecimals? Seems like it will just lead to confusion.
The text was updated successfully, but these errors were encountered: