From d1549b9fb2b5703ea1162a1802df664ab5ba7b43 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel Date: Tue, 2 Jun 2020 09:34:01 +0200 Subject: [PATCH] don't print parentheses for empty args --- src/ClearStacktrace.jl | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/ClearStacktrace.jl b/src/ClearStacktrace.jl index 53d7124..0c38413 100644 --- a/src/ClearStacktrace.jl +++ b/src/ClearStacktrace.jl @@ -123,21 +123,23 @@ function print_frame(io, i, func, inlined, modul, file, line, stypes, # function name printstyled(io, func, bold = true) - # type signature - printstyled(io, "(", color = :light_black) - - i = 1 - for (stype, (varname, vartype)) in zip(stypes, args) - if i > 1 - printstyled(io, ", ", color = :light_black) + if !isempty(args) + # type signature + printstyled(io, "(", color = :light_black) + + i = 1 + for (stype, (varname, vartype)) in zip(stypes, args) + if i > 1 + printstyled(io, ", ", color = :light_black) + end + printstyled(io, string(varname), color = :light_black, bold = true) + printstyled(io, "::") + printstyled(io, string(stype), color = :light_black) + i += 1 end - printstyled(io, string(varname), color = :light_black, bold = true) - printstyled(io, "::") - printstyled(io, string(stype), color = :light_black) - i += 1 - end - printstyled(io, ")", color = :light_black) + printstyled(io, ")", color = :light_black) + end println(io)