Repository navigation
Commit 4b42d73
committed
fix: in_op precedence
The Elixir parser rewrites `(!left) in right` into `!(left in right)`,
regardless of operator precedence. This rule does not exist in Spitfire,
causing a discrepancy in the generated ast.
Spitfire:
```elixir
{:in, _, [{:!, _, [left]}, right]}
```
Elixir:
```elixir
{:!, _, [{:in, _, [left, right]}]}
```
The fix is to add a clause for this rearrangement like the one in the
Elixir parser
[here](https://github.com/elixir-lang/elixir/blob/c40c140e3f524fa8384efd33137ec1c3fab341d3/lib/elixir/src/elixir_parser.yrl#L749-L756)1 parent dd45cb1 commit 4b42d73
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1012 | 1012 | | |
1013 | 1013 | | |
1014 | 1014 | | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1015 | 1025 | | |
1016 | 1026 | | |
1017 | 1027 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
814 | 814 | | |
815 | 815 | | |
816 | 816 | | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
817 | 820 | | |
818 | 821 | | |
819 | 822 | | |
| |||
0 commit comments