-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Code.Fragment.surround_context miss-categorises atom keys and &1 capture variables #13818
Comments
For 1, I agree, we should probably return keyword key or similar. 2 is correct. & is a unary operator, as seen in its AST: |
The docs call them value placehonders and limit
Contrary to that when
|
They are operators with different precedence. You can see if if you add quotes:
The reason why it is invalid, it is because it is parsed as
There could be an argument here that, because |
Let's have &123 as its own thing, since it could be useful in an editor. |
Elixir and Erlang/OTP versions
Erlang/OTP 26 [erts-14.2.5.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit]
Elixir 1.17.2 (compiled with Erlang/OTP 26)
Operating system
any
Current behavior
local_or_var
for atom keys in list, map, etcfor ordinary atoms it returns
unquoted_atom
&
operator but in this context&
is not an operator but a part of a special variable&123
Expected behavior
unquoted_atom
or more specificunquoted_atom_key
local_or_var
or something dedicatedThe text was updated successfully, but these errors were encountered: