Skip to content

Commit a75e946

Browse files
authored
Merge pull request #380 from julia-vscode/sp/fix-dollar-prime-parse
fix: parse quotenode with prime
2 parents 0fdcf9e + aa52cc9 commit a75e946

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/components/operators.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,8 @@ function parse_operator(ps::ParseState, ret::EXPR, op::EXPR)
479479
) ||
480480
headof(ret) === :do ||
481481
is_dot(headof(ret)) ||
482-
is_prime(headof(ret))
482+
is_prime(headof(ret)) ||
483+
isinterpolant(ret)
483484
if valof(op) == "'"
484485
ret = EXPR(op, EXPR[ret], nothing)
485486
else

test/parser/test_parser.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ end
197197
@test "m!=m" |> test_expr
198198
@test "+(x...)" |> test_expr
199199
@test "+(promote(x,y)...)" |> test_expr
200-
@test "\$(x...)" |> test_expr #
200+
@test "\$(x...)" |> test_expr
201201
@test "ccall(:gethostname, stdcall, Int32, ())" |> test_expr
202202
@test "@inbounds @ncall a b c" |> test_expr
203203
@test "(a+b)``" |> test_expr
@@ -1102,3 +1102,13 @@ end
11021102
@test test_expr("global a, b")
11031103
@test test_expr("global a, b = 2")
11041104
end
1105+
1106+
@testitem "dollar quote with prime" begin
1107+
using CSTParser: remlineinfo!
1108+
include("../shared.jl")
1109+
1110+
@test raw":($a'+2')" |> test_expr
1111+
@test raw":($(a)'+2')" |> test_expr
1112+
@test raw":($a')" |> test_expr
1113+
@test raw":($(a)')" |> test_expr
1114+
end

0 commit comments

Comments
 (0)