CSTParser.jl icon indicating copy to clipboard operation
CSTParser.jl copied to clipboard

dot transpose op expr does not parse as expected

Open o314 opened this issue 4 years ago • 3 comments

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 # see trans-op @ julia-parser.scm

FYI

""" :.' """  |> _log_parse

returns

(:quote, #QuoteNode
  :.'
)

o314 avatar Oct 05 '21 19:10 o314

Still an issue, or can be closed?

davidanthoff avatar Oct 15 '22 14:10 davidanthoff

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)

o314 avatar Oct 15 '22 14:10 o314

Also a tokenizer issues. Won't be fixed in this package.

pfitzseb avatar Oct 17 '22 13:10 pfitzseb