Skip to content

Commit 4e904a6

Browse files
committed
fix operator precendence printing of a in b. fixes #13822
1 parent 07ef29f commit 4e904a6

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

src/julia-parser.scm

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
(pushprec (cdr L) (+ prec 1)))))
6060
(pushprec (map eval prec-names) 1)
6161
t))
62+
(put! prec-table 'in (get prec-table '== 0)) ; add `in` to the prec-table
6263
(define (operator-precedence op) (get prec-table op 0))
6364

6465
(define unary-ops '(+ - ! ¬ ~ |<:| |>:| √ ∛ ∜))

test/show.jl

+2
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ end
7878
#@test_repr "w = (x = y) = z" # Doesn't pass, but it's an invalid assignment loc
7979
@test_repr "a & b && c"
8080
@test_repr "a & (b && c)"
81+
@test_repr "(a => b) in c"
82+
@test_repr "a => b in c"
8183

8284
# precedence tie resolution
8385
@test_repr "(a * b) * (c * d)"

0 commit comments

Comments
 (0)