@@ -883,8 +883,18 @@ handle_unary_op(Rest, Line, Column, Kind, Length, Op, Scope, Tokens) ->
883883 Token = {identifier , {Line , Column , nil }, Op },
884884 tokenize (Remaining , NewLine , NewColumn , Scope , [Token | Tokens ]);
885885 {Remaining , NewLine , NewColumn } ->
886+ NewScope =
887+ % % TODO: Remove these deprecations on Elixir v2.0
888+ case Op of
889+ '~~~' ->
890+ Msg = " ~~ ~ is deprecated. Use Bitwise.bnot/1 instead for clarity" ,
891+ prepend_warning (Line , Column , Msg , Scope );
892+ _ ->
893+ Scope
894+ end ,
895+
886896 Token = {Kind , {Line , Column , nil }, Op },
887- tokenize (Remaining , NewLine , NewColumn , Scope , [Token | Tokens ])
897+ tokenize (Remaining , NewLine , NewColumn , NewScope , [Token | Tokens ])
888898 end .
889899
890900handle_op ([$: | Rest ], Line , Column , _Kind , Length , Op , Scope , Tokens ) when ? is_space (hd (Rest )) ->
@@ -904,10 +914,6 @@ handle_op(Rest, Line, Column, Kind, Length, Op, Scope, Tokens) ->
904914 Msg = " ^^^ is deprecated. It is typically used as xor but it has the wrong precedence, use Bitwise.bxor/2 instead" ,
905915 prepend_warning (Line , Column , Msg , Scope );
906916
907- '~~~' ->
908- Msg = " ~~ ~ is deprecated. Use Bitwise.bnot/1 instead for clarity" ,
909- prepend_warning (Line , Column , Msg , Scope );
910-
911917 '<|>' ->
912918 Msg = " <|> is deprecated. Use another pipe-like operator" ,
913919 prepend_warning (Line , Column , Msg , Scope );
0 commit comments