Skip to content

Commit 4931629

Browse files
committed
Add :++, :-- and :** to Macro#binary_op_props
1 parent 703c7df commit 4931629

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lib/elixir/lib/macro.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ defmodule Macro do
4242
o when o in [:+, :-] -> {:left, 210}
4343
o when o in [:*, :/] -> {:left, 220}
4444
o when o in [:<>] -> {:right, 230}
45+
o when o in [:++, :--, :**] -> {:right, 240}
4546
:^^^ -> {:left, 250}
4647
:. -> {:left, 310}
4748
end

lib/elixir/test/elixir/macro_test.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ defmodule MacroTest do
333333
assert Macro.to_string(quote do: 1 + 2) == "1 + 2"
334334
assert Macro.to_string(quote do: [ 1, 2 | 3 ]) == "[1, 2 | 3]"
335335
assert Macro.to_string(quote do: [h|t] = [1, 2, 3]) == "[h | t] = [1, 2, 3]"
336+
assert Macro.to_string(quote do: (x ++ y) ++ z) == "(x ++ y) ++ z"
336337
end
337338

338339
test :unary_ops_to_string do

0 commit comments

Comments
 (0)