Skip to content

Commit aa52cc9

Browse files
committed
fix: parse quotenode with prime
1 parent 027ee01 commit aa52cc9

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
@@ -1101,3 +1101,13 @@ end
11011101
@test test_expr("global a, b")
11021102
@test test_expr("global a, b = 2")
11031103
end
1104+
1105+
@testitem "dollar quote with prime" begin
1106+
using CSTParser: remlineinfo!
1107+
include("../shared.jl")
1108+
1109+
@test raw":($a'+2')" |> test_expr
1110+
@test raw":($(a)'+2')" |> test_expr
1111+
@test raw":($a')" |> test_expr
1112+
@test raw":($(a)')" |> test_expr
1113+
end

0 commit comments

Comments
 (0)