diff options
author | José Valim <jose.valim@plataformatec.com.br> | 2017-09-28 18:32:52 +0200 |
---|---|---|
committer | José Valim <jose.valim@plataformatec.com.br> | 2017-09-28 18:32:52 +0200 |
commit | e8d5c70baa2cf80eab4d94dd325bd92192017d2d (patch) | |
tree | c29b58bb81d620b0a3c0eb0c43302dcfd9498dfa /lib | |
parent | c0fd3d265589e15c2af8a434d7f103d838444c00 (diff) | |
download | elixir-e8d5c70baa2cf80eab4d94dd325bd92192017d2d.tar.gz |
Move & up in the operator table to avoid conflicts with | in cons, closes #6613
Diffstat (limited to 'lib')
-rw-r--r-- | lib/elixir/lib/code/identifier.ex | 2 | ||||
-rw-r--r-- | lib/elixir/pages/Operators.md | 2 | ||||
-rw-r--r-- | lib/elixir/src/elixir_parser.yrl | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/elixir/lib/code/identifier.ex b/lib/elixir/lib/code/identifier.ex index 58ba56606..4fce4cd8c 100644 --- a/lib/elixir/lib/code/identifier.ex +++ b/lib/elixir/lib/code/identifier.ex @@ -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 [:@] -> diff --git a/lib/elixir/pages/Operators.md b/lib/elixir/pages/Operators.md index 566c13e7b..84217bedf 100644 --- a/lib/elixir/pages/Operators.md +++ b/lib/elixir/pages/Operators.md @@ -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 diff --git a/lib/elixir/src/elixir_parser.yrl b/lib/elixir/src/elixir_parser.yrl index 2e790f510..93b0178c5 100644 --- a/lib/elixir/src/elixir_parser.yrl +++ b/lib/elixir/src/elixir_parser.yrl @@ -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. %% ==, !=, =~, ===, !== |