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

Fix split_function_nothrow failing on poorly defined functions #86

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/analysis/split.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

Split doc string from given expression.
"""
function split_doc(ex::Expr)
Roger-luo marked this conversation as resolved.
Show resolved Hide resolved
function split_doc(ex)
@switch ex begin
@case Expr(:macrocall, &(GlobalRef(Core, Symbol("@doc"))), line, doc, expr) ||
Expr(:macrocall, &(Symbol("@doc")), line, doc, expr) ||
Expand All @@ -26,13 +26,13 @@ end

Split function head declaration with function body.
"""
function split_function(ex::Expr; source = nothing)
function split_function(ex; source = nothing)
ret = split_function_nothrow(ex)
isnothing(ret) && throw(SyntaxError("expect a function expr, got $ex", source))
ret
end

function split_function_nothrow(ex::Expr)
function split_function_nothrow(ex)
@match ex begin
Expr(:function, call, body) => (:function, call, body)
Expr(:function, call, body) => (:function, call, body)
Expand Down
Loading