CSTParser.jl
CSTParser.jl copied to clipboard
expr op prime not recognized correctly
import CSTParser as C
using Test
_eval_or_ex(a) = try; a catch ex; ex end
_backtest_parse(s) = (s |> Meta.parse) == (s |> C.parse |> Expr)
_log_parse(s) = s |> Meta.parse |> Meta.show_sexpr
@test_broken """ :?' """ |> _backtest_parse
Is this still an issue, or can it be closed?
dup of 316 answer Still an issue @ CSTParser v3.3.6
@testset for (arg, exp) in eachrow([
""" :.' """ QuoteNode(:var".'") ; # issue 316
""" g <| 1 |> f """ Expr(:call, :<|, :g, Expr(:call, :|>, 1, :f)) ; # issue 318
""" :?' """ Expr(Symbol("'"), QuoteNode(:?)) # issue 319
])
@test Meta.parse(arg) == exp
@test_broken C.parse(arg) == exp
end
(should be included in runtests.jl)
This is a tokenizer issue. I don't think we'll ever end up fixing that in this package.