diff --git a/src/julia-parser.scm b/src/julia-parser.scm index 9d832894f9bb1..45ea82252f2d7 100644 --- a/src/julia-parser.scm +++ b/src/julia-parser.scm @@ -830,7 +830,7 @@ (first? #t)) (let* ((t (peek-token s)) (spc (ts:space? s))) - (cond ((and first? (eq? t '|..|)) + (cond ((and first? (is-prec-colon? t) (not (eq? t ':))) (take-token s) `(call ,t ,ex ,(parse-expr s))) ((and range-colon-enabled (eq? t ':)) diff --git a/test/syntax.jl b/test/syntax.jl index 4a0c7a390850f..90746786cd5bc 100644 --- a/test/syntax.jl +++ b/test/syntax.jl @@ -1728,3 +1728,10 @@ function test_26037() end end @test test_26037() === nothing # no UndefVarError + +# range and interval operators +@test Meta.parse("1…2") == Expr(:call, :…, 1, 2) +@test Meta.parse("1⁝2") == Expr(:call, :⁝, 1, 2) +@test Meta.parse("1..2") == Expr(:call, :.., 1, 2) +# we don't parse chains of these since the associativity and meaning aren't clear +@test_throws ParseError Meta.parse("1..2..3")