Skip to content

What to do about "do macrocalls" #319

Closed
@c42f

Description

@c42f

"do macrocalls" have an expression representation which is the same as do function calls. But the macrocall in this case acts not only on the its children, but on the body of the do block.

It seems pretty weird for a macro expansion to act outside its child list in the expression tree, and this is the only such case.

Currently we have the following representation

julia> parsestmt(SyntaxNode, "@f(x, y) do a, b\n body\n end")
line:col│ tree                                   │ file_name
   1:1  │[do]
   1:1  │  [macrocall-p]
   1:2  │    @f
   1:4  │    x
   1:7  │    y
   1:12 │  [tuple]
   1:13 │    a
   1:16 │    b
   1:17 │  [block]
   2:2  │    body

Is there a neat alternative AST we could use to fix this special case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions