Skip to content

Commit

Permalink
支持使用宏展开为函数分支
Browse files Browse the repository at this point in the history
  • Loading branch information
shuying2244 committed Nov 26, 2024
1 parent b4743cf commit a21b95c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/els_lsp/src/els_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -798,7 +798,13 @@ analyze_function(FunName, Clauses0) ->

-spec function_args(tree()) -> {arity(), els_arg:args()}.
function_args(Clause) ->
Patterns = erl_syntax:clause_patterns(Clause),
Patterns =
case Clause of
{_, macro, _, _} ->
erl_syntax:macro_arguments(Clause);
_ ->
erl_syntax:clause_patterns(Clause)
end,
Arity = length(Patterns),
Args = args_from_subtrees(Patterns),
{Arity, Args}.
Expand Down

0 comments on commit a21b95c

Please sign in to comment.