Roger-luo/Expronicon.jl

BUG: Incorrect anonymous functions are still parsed

Opened this issue · 0 comments

julia> JLFunction(:(foo(bar) -> x))
foo(bar) -> x

julia> JLFunction(:(foo(bar) -> x)) |> dump
JLFunction
  head: Symbol ->
  name: Symbol foo
  args: Array{Any}((1,))
    1: Symbol bar
  kwargs: Nothing nothing
  rettype: Nothing nothing
  generated: Bool false
  whereparams: Nothing nothing
  body: Expr
    head: Symbol block
    args: Array{Any}((2,))
      1: LineNumberNode
        line: Int64 1
        file: Symbol REPL[10]
      2: Symbol x
  line: Nothing nothing
  doc: Nothing nothing

While

julia> foo(bar) -> x
ERROR: syntax: "foo(bar)" is not a valid function argument name around REPL[1]:1
Stacktrace:
[1] top-level scope
 @ REPL[1]:1

cc @walterl