@@ -452,7 +452,6 @@ expand({{'.', DotMeta, [Left, Right]}, Meta, Args}, S, E)
452
452
expand ({{'.' , DotMeta , [Expr ]}, Meta , Args }, S , E ) when is_list (Args ) ->
453
453
assert_no_match_or_guard_scope (Meta , " anonymous call" , S , E ),
454
454
{[EExpr | EArgs ], SA , EA } = expand_args ([Expr | Args ], S , E ),
455
- is_atom (EExpr ) andalso function_error (Meta , E , ? MODULE , {invalid_function_call , EExpr }),
456
455
{{{'.' , DotMeta , [EExpr ]}, Meta , EArgs }, SA , EA };
457
456
458
457
% % Invalid calls
@@ -887,7 +886,6 @@ expand_remote(Receiver, DotMeta, Right, Meta, Args, S, SL, #{context := Context}
887
886
888
887
case rewrite (Context , Receiver , DotMeta , Right , AttachedMeta , EArgs , S ) of
889
888
{ok , Rewritten } ->
890
- maybe_warn_comparison (Rewritten , Args , E ),
891
889
{Rewritten , elixir_env :close_write (SA , S ), EA };
892
890
893
891
{error , Error } ->
@@ -914,32 +912,6 @@ rewrite(guard, Receiver, DotMeta, Right, Meta, EArgs, S) ->
914
912
rewrite (_ , Receiver , DotMeta , Right , Meta , EArgs , _S ) ->
915
913
{ok , elixir_rewrite :rewrite (Receiver , DotMeta , Right , Meta , EArgs )}.
916
914
917
- maybe_warn_comparison ({{'.' , _ , [erlang , Op ]}, Meta , [ELeft , ERight ]}, [Left , Right ], E )
918
- when Op =:= '>' ; Op =:= '<' ; Op =:= '=<' ; Op =:= '>=' ; Op =:= min ; Op =:= max ->
919
-
920
- case is_nested_comparison (Op , ELeft , ERight , Left , Right ) of
921
- false -> ok ;
922
- CompExpr ->
923
- elixir_errors :file_warn (Meta , E , ? MODULE , {nested_comparison , CompExpr })
924
- end ;
925
- maybe_warn_comparison (_ , _ , _ ) ->
926
- ok .
927
-
928
- is_nested_comparison (Op , ELeft , ERight , Left , Right ) ->
929
- NestedExpr = {elixir_utils :erlang_comparison_op_to_elixir (Op ), [], [Left , Right ]},
930
- case is_comparison_expression (ELeft ) of
931
- true ->
932
- NestedExpr ;
933
- false ->
934
- case is_comparison_expression (ERight ) of
935
- true -> NestedExpr ;
936
- false -> false
937
- end
938
- end .
939
- is_comparison_expression ({{'.' ,_ ,[erlang , Op ]},_ ,_ })
940
- when Op =:= '>' ; Op =:= '<' ; Op =:= '=<' ; Op =:= '>=' -> true ;
941
- is_comparison_expression (_Other ) -> false .
942
-
943
915
% % Lexical helpers
944
916
945
917
expand_opts (Meta , Kind , Allowed , Opts , S , E ) ->
@@ -1241,8 +1213,6 @@ format_error({invalid_clauses, Name}) ->
1241
1213
" the function \" ~ts \" cannot handle clauses with the -> operator because it is not a macro. "
1242
1214
" Please make sure you are invoking the proper name and that it is a macro" ,
1243
1215
io_lib :format (Message , [Name ]);
1244
- format_error ({invalid_function_call , Expr }) ->
1245
- io_lib :format (" invalid function call :~ts .()" , [Expr ]);
1246
1216
format_error ({invalid_call , Call }) ->
1247
1217
io_lib :format (" invalid call ~ts " , ['Elixir.Macro' :to_string (Call )]);
1248
1218
format_error ({invalid_quoted_expr , Expr }) ->
0 commit comments