Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

lpipe rpipe do not mix #318

Closed
o314 opened this issue Oct 5, 2021 · 3 comments
Closed

lpipe rpipe do not mix #318

o314 opened this issue Oct 5, 2021 · 3 comments
Labels

Comments

@o314
Copy link

o314 commented Oct 5, 2021

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 """ g <| 1 |> f """ |> _backtest_parse
@davidanthoff
Copy link
Member

Is this still an issue, or can it be closed?

@o314
Copy link
Author

o314 commented Oct 15, 2022

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)

@pfitzseb
Copy link
Member

Can't repro on master:

julia> CSTParser.to_codeobject(CSTParser.parse("g <| 1 |> f")) == Meta.parse("g <| 1 |> f")
true

julia> dump(CSTParser.to_codeobject(CSTParser.parse("g <| 1 |> f")))
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol <|
    2: Symbol g
    3: Expr
      head: Symbol call
      args: Array{Any}((3,))
        1: Symbol |>
        2: Int64 1
        3: Symbol f

julia> dump(Meta.parse("g <| 1 |> f"))
Expr
  head: Symbol call
  args: Array{Any}((3,))
    1: Symbol <|
    2: Symbol g
    3: Expr
      head: Symbol call
      args: Array{Any}((3,))
        1: Symbol |>
        2: Int64 1
        3: Symbol f

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants