From aa52cc90cb7243cb54d741c0c677b62c2c774072 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 8 Jan 2024 13:49:33 +0100 Subject: [PATCH] fix: parse quotenode with prime --- src/components/operators.jl | 3 ++- test/parser/test_parser.jl | 12 +++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/components/operators.jl b/src/components/operators.jl index 2a4f6bfb..4bc10506 100644 --- a/src/components/operators.jl +++ b/src/components/operators.jl @@ -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 diff --git a/test/parser/test_parser.jl b/test/parser/test_parser.jl index 0180c02c..de7fff21 100644 --- a/test/parser/test_parser.jl +++ b/test/parser/test_parser.jl @@ -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 @@ -1101,3 +1101,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