Skip to content

Commit b799e9e

Browse files
committed
Revert formatter changes to ||| and &&&, closes #13711
1 parent 220c228 commit b799e9e

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

lib/elixir/lib/code/formatter.ex

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ defmodule Code.Formatter do
3131
@right_new_line_before_binary_operators [:|, :when]
3232

3333
# Operators that are logical cannot be mixed without parens
34-
@required_parens_logical_binary_operands [:||, :or, :&&, :and]
34+
@required_parens_logical_binary_operands [:|||, :||, :or, :&&&, :&&, :and]
3535

3636
# Operators with next break fits
3737
@next_break_fits_operators [:<-, :==, :!=, :=~, :===, :!==, :<, :>, :<=, :>=, :=, :"::"]
@@ -44,8 +44,6 @@ defmodule Code.Formatter do
4444
# when they are the parent of another operator with a difference precedence
4545
# Most operators are listed, except comparison, arithmetic, and low precedence
4646
@required_parens_on_binary_operands [
47-
:|||,
48-
:&&&,
4947
:<<<,
5048
:>>>,
5149
:|>,

lib/elixir/test/elixir/code_formatter/operators_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ defmodule Code.Formatter.OperatorsTest do
170170
end
171171

172172
test "bitwise precedence" do
173-
assert_same "(crc >>> 8) ||| byte"
173+
assert_format "(crc >>> 8) ||| byte", "crc >>> 8 ||| byte"
174174
assert_same "crc >>> (8 ||| byte)"
175175
end
176176
end

0 commit comments

Comments
 (0)