You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In the Julia syntax, both calls and macrocalls exist. However, Semgrep generates ASTs with the same node (Call) for both of them. For example, for basic calls:
This can be problematic when writing rules. For example, a struct wrapped around Base.@kwdef gets matched as a function call: https://semgrep.dev/playground/s/WAyDy. This can be avoided like this, but it seems a bit frail and I think they should be treated differently anyway.
The tree sitter seems to differentiate as well between function calls and macro calls, so I believe the problem is with the Semgrep generated AST.
As a note, macro definitions and function definitions are treated differently:
Describe the bug
In the Julia syntax, both
calls
andmacrocalls
exist. However, Semgrep generates ASTs with the same node (Call
) for both of them. For example, for basic calls:f(x)
:@m(x)
:This can be problematic when writing rules. For example, a
struct
wrapped aroundBase.@kwdef
gets matched as a function call: https://semgrep.dev/playground/s/WAyDy. This can be avoided like this, but it seems a bit frail and I think they should be treated differently anyway.The tree sitter seems to differentiate as well between function calls and macro calls, so I believe the problem is with the Semgrep generated AST.
As a note, macro definitions and function definitions are treated differently:
f(x) = x
:macro m(x) :(x) end
:To Reproduce
The playground link above.
Expected behavior
Macro calls should be treated differently. Maybe they should not be matched with
$X(...)
, but with@$X(...)
?What is the priority of the bug to you?
Use case
This would make the generated AST more correct/complete.
The text was updated successfully, but these errors were encountered: