From 206b77f54ba91f6c350ad135948b8ea6822aa433 Mon Sep 17 00:00:00 2001 From: hhaensel Date: Thu, 12 Dec 2024 19:54:16 +0100 Subject: [PATCH] rename T_old to T --- src/Stipple.jl | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Stipple.jl b/src/Stipple.jl index 4c4387f..5af0de1 100644 --- a/src/Stipple.jl +++ b/src/Stipple.jl @@ -1020,10 +1020,10 @@ macro kwredef(expr) n=1 end - T_old = t[n] + T = t[n] - if isa(T_old, Expr) && T_old.head == Symbol(".") - T_old = (split(string(T_old), '.')[end] |> Symbol) + if isa(T, Expr) && T.head == Symbol(".") + T = (split(string(T), '.')[end] |> Symbol) end # in the first run the datatype is not yet defined @@ -1032,15 +1032,14 @@ macro kwredef(expr) called_first_time = !isa(T_old, DataType) t[n] = T_new = called_first_time ? Symbol(T_old, :def) : gensym(T_old) - esc(quote + quote Base.@kwdef $expr - $T_old = $T_new + $T = $T_new if Base.VERSION < v"1.8-" - $curly ? $T_new.body.name.name = $(QuoteNode(T_old)) : $T_new.name.name = $(QuoteNode(T_old)) # fix the name + $curly ? $T_new.body.name.name = $(QuoteNode(T)) : $T_new.name.name = $(QuoteNode(T)) # fix the name end - $T_new - end) + end |> esc end """