Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

interpret &(a,b) as a call expresion #34767

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
(define syntactic-operators
(append! (add-dots '(= += -= *= /= //= |\\=| ^= ÷= %= <<= >>= >>>= |\|=| &= ⊻=))
'(:= --> $= && |\|\|| |.| ... ->)))
(define syntactic-unary-operators '($ & |::|))
(define syntactic-unary-operators '($ |::|))

(define syntactic-op? (Set syntactic-operators))
(define syntactic-unary-op? (Set syntactic-unary-operators))
Expand Down
3 changes: 0 additions & 3 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ end

@test replstr(Meta.parse("mutable struct X end")) == ":(mutable struct X\n #= none:1 =#\n end)"
@test replstr(Meta.parse("struct X end")) == ":(struct X\n #= none:1 =#\n end)"
let s = "ccall(:f, Int, (Ptr{Cvoid},), &x)"
@test replstr(Meta.parse(s)) == ":($s)"
end

# recursive array printing
# issue #10353
Expand Down
7 changes: 0 additions & 7 deletions test/syntax.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ macro test999_str(args...); args; end

@test parseall("a = &\nb") == Expr(:block, Expr(:(=), :a, :&), :b)
@test parseall("a = \$\nb") == Expr(:block, Expr(:(=), :a, :$), :b)
@test parseall(":(a = &\nb)") == Expr(:quote, Expr(:(=), :a, Expr(:&, :b)))
@test parseall(":(a = \$\nb)") == Expr(:quote, Expr(:(=), :a, Expr(:$, :b)))

# issue 11970
Expand Down Expand Up @@ -1084,9 +1083,6 @@ end
@test_throws ParseError Meta.parse("x@time 2")
@test_throws ParseError Meta.parse("@ time")

# issue #7479
@test Meta.lower(Main, Meta.parse("(true &&& false)")) == Expr(:error, "invalid syntax &false")

# if an indexing expression becomes a cat expression, `end` is not special
@test_throws ParseError Meta.parse("a[end end]")
@test_throws ParseError Meta.parse("a[end;end]")
Expand Down Expand Up @@ -1657,9 +1653,6 @@ end
end
@test M22314.i == 0

# #6080
@test Meta.lower(@__MODULE__, :(ccall(:a, Cvoid, (Cint,), &x))) == Expr(:error, "invalid syntax &x")

@test_throws ParseError Meta.parse("x.'")
@test_throws ParseError Meta.parse("0.+1")

Expand Down