From a868a0ade85900c749d3203f9ec32c3b79213259 Mon Sep 17 00:00:00 2001 From: a Date: Mon, 22 Jul 2024 12:28:36 +0200 Subject: [PATCH] fix --- src/analysis/split.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/analysis/split.jl b/src/analysis/split.jl index 931d1c1..36106a8 100644 --- a/src/analysis/split.jl +++ b/src/analysis/split.jl @@ -3,7 +3,7 @@ Split doc string from given expression. """ -function split_doc(ex::Expr) +function split_doc(ex) @switch ex begin @case Expr(:macrocall, &(GlobalRef(Core, Symbol("@doc"))), line, doc, expr) || Expr(:macrocall, &(Symbol("@doc")), line, doc, expr) || @@ -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)