Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Parsing of function inside macro call using () #13210

Closed
mauro3 opened this issue Sep 18, 2015 · 1 comment
Closed

Parsing of function inside macro call using () #13210

mauro3 opened this issue Sep 18, 2015 · 1 comment
Labels
parser Language parsing and surface syntax

Comments

@mauro3
Copy link
Contributor

mauro3 commented Sep 18, 2015

This does not work:

julia> @inbounds( f(x) = :x)
ERROR: unsupported or misplaced expression kw

julia> @generated( f(x) = :x)
ERROR: invalid syntax; @generated must be used with a function definition

it looks like the parsing is off and makes the function into :kw:

julia> macro m(x)
       println(xdump(x))
       end

julia> @m( f(x)=1)
Expr 
  head: Symbol kw
  args: Array(Any,(2,))
    1: Expr 
      head: Symbol call
      args: Array(Any,(2,))
        1: Symbol f
        2: Symbol x
      typ: Any::DataType  <: Any
    2: Int64 1
  typ: Any::DataType  <: Any
nothing
@yuyichao yuyichao added the parser Language parsing and surface syntax label Sep 18, 2015
@mbauman
Copy link
Member

mbauman commented Sep 18, 2015

Dup of #7669

@mbauman mbauman closed this as completed Sep 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parser Language parsing and surface syntax
Projects
None yet
Development

No branches or pull requests

3 participants