Skip to content

Commit 9354149

Browse files
committed
Simplify with Macro.operator?/2
1 parent 2af0411 commit 9354149

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/elixir/lib/code/normalizer.ex

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,7 @@ defmodule Code.Normalizer do
333333

334334
defp allow_keyword?(:when, 2), do: true
335335
defp allow_keyword?(:{}, _), do: false
336-
defp allow_keyword?(op, 1), do: Code.Identifier.unary_op(op) == :error
337-
defp allow_keyword?(op, 2), do: Code.Identifier.binary_op(op) == :error
338-
defp allow_keyword?(_, _), do: true
336+
defp allow_keyword?(op, arity), do: not is_atom(op) or not Macro.operator?(op, arity)
339337

340338
defp normalize_bitstring({:<<>>, meta, parts} = quoted, state, escape_interpolation \\ false) do
341339
meta = patch_meta_line(meta, state.parent_meta)

0 commit comments

Comments
 (0)