-
Notifications
You must be signed in to change notification settings - Fork 41
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
Use depth-limited type printing, from Julia 1.10 #566
Comments
I think someone would just need to truncate this and add some option to enable/disable it, Cthulhu.jl/TypedSyntax/src/show.jl Line 121 in 17c53a1
|
I have a branch where I'm experimenting with depth-limited type printing, and that unfortunately doesn't seem to be working |
Are you sure you're using your custom TypedSyntax, it's its own package. Just loading your branch of Cthulhu won't work I think. |
Yeah, I did |
That's odd, I changed that line to julia> @descend sin(42.)
sin(x::T) where T<:Union{Float32, Float64} @ Base.Math C:\Users\gag\.julia\juliaup\julia-1.10.2+0.x64.w64.mingw32\share\julia\base\special\trig.jl:29
29 function (sin(x::Fl::T) where T<:Union{Float32, Float64})::Fl
30 absx::Fl = abs(x::Fl)::Fl
31 if (absx::Fl < (T::Ty(pi::Ir)::Fl/4)::Fl)::Bo #|x| ~<= pi/4, no need for reduction
32 if (absx::Fl < sqrt(eps(T::Ty)::Fl)::Fl)::Bo
33 return x::Fl
34 end
35 return sin_kernel(x::Fl)::Fl
36 elseif isnan(x::Fl)::Bo
37 return x::Fl
38 elseif isinf(x::Fl)::Bo
39 sin_domain_error(x::Fl)
40 end
41 n::In, y::Ba = rem_pio2_kernel(x::Fl)::Tu::Ba
42 n::In = (n::In&3)::In
43 if (n::In == 0)::Bo
44 return sin_kernel(y::Ba)::Fl
45 elseif (n::In == 1)::Bo
46 return cos_kernel(y::Ba)::Fl
47 elseif (n::In == 2)::Bo
48 return -(sin_kernel(y::Ba)::Fl)::Fl
49 else
50 return -(cos_kernel(y::Ba)::Fl)::Fl
51 end
52 end
Select a call to descend into or ↩ to ascend. [q]uit. [b]ookmark.
Toggles: [w]arn, [h]ide type-stable statements, [t]ype annotations, [s]yntax highlight for Source/LLVM/Native, [j]ump to source always, [v]scode: inlay types, [V]scode: diagnostics.
Show: [S]ource code, [A]ST, [T]yped code, [L]LVM IR, [N]ative code
Actions: [E]dit source code, [R]evise and redisplay
• abs(x::Fl)
T::Ty(pi::Ir)
T::Ty(pi::Ir)::Fl/4
absx::Fl < (T::Ty(pi::Ir)::Fl/4)::Fl
eps(T::Ty)
sqrt(eps(T::Ty)::Fl)
absx::Fl < sqrt(eps(T::Ty)::Fl)::Fl
sin_kernel(x::Fl)
isnan(x::Fl)
v isinf(x::Fl) |
Huh, interesting, I'll try again |
Hmm, I can't even error inside that function. Can you put an error in there and show the stack trace? |
I might have to Cthulhu Cthulhu 😵💫 |
We call the printstyled in the |
Also, we pass an iocontext object to printstyled so perhaps just add the type limit to that like we do at https://github.com/JuliaDebug/Cthulhu.jl/blob/master/TypedSyntax/src/show.jl#L117-118 |
Ah, wow, when I did |
Looks like its working now |
This is my analog request of aviatesk/JET.jl#616
The text was updated successfully, but these errors were encountered: