Skip to content

Commit

Permalink
add special cased function renderings (intrinsics and builtins)
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Mar 28, 2020
1 parent 7820bd0 commit 61c97b7
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/display/base.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,20 @@ isanon(f) = startswith(string(typeof(f).name.mt.name), "#")
isanon(f) ? span(".syntax--support.syntax--function", "λ") :
LazyTree(span(".syntax--support.syntax--function", string(typeof(f).name.mt.name)),
()->[(Atom.CodeTools.hasdoc(f) ? [md_hlines(doc(f))] : [])..., methods(f)])

@render Inline f::Core.IntrinsicFunction begin
id = Core.Intrinsics.bitcast(Int32, f)
span(c(span(".syntax--support.syntax--function", string(f)), " (intrinsic function #$id)"))
end

@render Inline f::Core.Builtin begin
LazyTree(
span(c(
span(".syntax--support.syntax--function", string(typeof(f).name.mt.name)),
" (built-in function)"
)),
()->[(Atom.CodeTools.hasdoc(f) ? [md_hlines(doc(f))] : [])..., methods(f)]
)
end

# TODO: lazy load a recursive tree
Expand Down

0 comments on commit 61c97b7

Please sign in to comment.