Skip to content

Commit

Permalink
Merge pull request #380 from julia-vscode/sp/fix-dollar-prime-parse
Browse files Browse the repository at this point in the history
fix: parse quotenode with prime
  • Loading branch information
pfitzseb committed Jan 8, 2024
2 parents 0fdcf9e + aa52cc9 commit a75e946
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,8 @@ function parse_operator(ps::ParseState, ret::EXPR, op::EXPR)
) ||
headof(ret) === :do ||
is_dot(headof(ret)) ||
is_prime(headof(ret))
is_prime(headof(ret)) ||
isinterpolant(ret)
if valof(op) == "'"
ret = EXPR(op, EXPR[ret], nothing)
else
Expand Down
12 changes: 11 additions & 1 deletion test/parser/test_parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ end
@test "m!=m" |> test_expr
@test "+(x...)" |> test_expr
@test "+(promote(x,y)...)" |> test_expr
@test "\$(x...)" |> test_expr #
@test "\$(x...)" |> test_expr
@test "ccall(:gethostname, stdcall, Int32, ())" |> test_expr
@test "@inbounds @ncall a b c" |> test_expr
@test "(a+b)``" |> test_expr
Expand Down Expand Up @@ -1102,3 +1102,13 @@ end
@test test_expr("global a, b")
@test test_expr("global a, b = 2")
end

@testitem "dollar quote with prime" begin
using CSTParser: remlineinfo!
include("../shared.jl")

@test raw":($a'+2')" |> test_expr
@test raw":($(a)'+2')" |> test_expr
@test raw":($a')" |> test_expr
@test raw":($(a)')" |> test_expr
end

0 comments on commit a75e946

Please # to comment.