@@ -684,13 +684,19 @@ number_value({_, {_, _, Value}, _}) ->
|
||||
%% Operators
|
||||
|
||||
build_op({_Kind, Location, 'in'}, {UOp, _, [Left]}, Right) when ?rearrange_uop(UOp) ->
|
||||
%% TODO: Raise on "not left in right" rearrangement on 2.0
|
||||
%% TODO: Remove "not left in right" rearrangement on 2.0
|
||||
elixir_errors:warn(line_from_location(Location), ?file(),
|
||||
"\"not expr1 in expr2\" is deprecated. Use \"expr1 not in expr2\" instead"),
|
||||
{UOp, meta_from_location(Location), [{'in', meta_from_location(Location), [Left, Right]}]};
|
||||
|
||||
build_op({_Kind, Location, 'not in'}, Left, Right) ->
|
||||
{'not', meta_from_location(Location), [{'in', meta_from_location(Location), [Left, Right]}]};
|
||||
InMeta = meta_from_location(Location),
|
||||
NotMeta =
|
||||
case ?formatter_metadata() of
|
||||
true -> [{operator, 'not in'} | InMeta];
|
||||
false -> InMeta
|
||||
end,
|
||||
{'not', NotMeta, [{'in', InMeta, [Left, Right]}]};
|
||||
build_op({_Kind, Location, Op}, Left, Right) ->
|
||||
{Op, eol_op(Location) ++ meta_from_location(Location), [Left, Right]}.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user