Skip to content

Commit

Permalink
Move & up in the operator table to avoid conflicts with | in cons, cl…
Browse files Browse the repository at this point in the history
  • Loading branch information
José Valim committed Sep 28, 2017
1 parent c0fd3d2 commit e8d5c70
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/elixir/lib/code/identifier.ex
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Code.Identifier do
def unary_op(op) do
cond do
op in [:&] ->
{:non_associative, 30}
{:non_associative, 100}
op in [:!, :^, :not, :+, :-, :~~~] ->
{:non_associative, 300}
op in [:@] ->
Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/pages/Operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ Operator
`==` `!=` `=~` `===` `!==` | Left to right
`&&` `&&&` `and` | Left to right
`\|\|` `\|\|\|` `or` | Left to right
`&` | Unary
`=` | Right to left
`=>` | Right to left
`\|` | Right to left
`::` | Right to left
`when` | Right to left
`<-`, `\\` | Left to right
`&` | Unary

## Comparison operators

Expand Down
2 changes: 1 addition & 1 deletion lib/elixir/src/elixir_parser.yrl
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ Expect 3.
Left 5 do.
Right 10 stab_op_eol. %% ->
Left 20 ','.
Nonassoc 30 capture_op_eol. %% &
Left 40 in_match_op_eol. %% <-, \\ (allowed in matches along =)
Right 50 when_op_eol. %% when
Right 60 type_op_eol. %% ::
Right 70 pipe_op_eol. %% |
Right 80 assoc_op_eol. %% =>
Right 90 match_op_eol. %% =
Nonassoc 100 capture_op_eol. %% &
Left 130 or_op_eol. %% ||, |||, or
Left 140 and_op_eol. %% &&, &&&, and
Left 150 comp_op_eol. %% ==, !=, =~, ===, !==
Expand Down

0 comments on commit e8d5c70

Please sign in to comment.