@@ -237,13 +237,14 @@ Test whether expression `ex` is a `@doc` expression.
237
237
function is_doc_expr (@nospecialize (ex))
238
238
docsym = Symbol (" @doc" )
239
239
if isexpr (ex, :macrocall )
240
- ex:: Expr
241
240
length (ex. args) == 4 || return false
242
241
a = ex. args[1 ]
243
- is_global_ref (a, Core, docsym) && return true
244
- isa (a, Symbol) && a == docsym && return true
245
- if isexpr (a, :.)
246
- mod, name = (a:: Expr ). args[1 ], (a:: Expr ). args[2 ]
242
+ if isa (a, Symbol) && a === docsym
243
+ return true
244
+ elseif is_global_ref (a, Core, docsym)
245
+ return true
246
+ elseif isexpr (a, :.)
247
+ mod, name = a. args[1 ], a. args[2 ]
247
248
return mod === :Core && isa (name, QuoteNode) && name. value === docsym
248
249
end
249
250
end
@@ -682,7 +683,7 @@ respectively) can be evaluated using the syntax `var"%3"` and `var"@_4"` respect
682
683
"""
683
684
function eval_code end
684
685
685
- function extract_usage! (s:: Set{Symbol} , expr)
686
+ function extract_usage! (s:: Set{Symbol} , @nospecialize expr)
686
687
if expr isa Expr
687
688
for arg in expr. args
688
689
if arg isa Symbol
@@ -753,7 +754,7 @@ function eval_code(frame::Frame, expr::Expr)
753
754
eval_res
754
755
end
755
756
756
- function show_stackloc (io:: IO , frame)
757
+ function show_stackloc (io:: IO , frame:: Frame )
757
758
indent = " "
758
759
fr = root (frame)
759
760
shown = false
@@ -772,7 +773,7 @@ function show_stackloc(io::IO, frame)
772
773
println (io, indent, scopeof (frame), " , pc = " , frame. pc)
773
774
end
774
775
end
775
- show_stackloc (frame) = show_stackloc (stdout , frame)
776
+ show_stackloc (frame:: Frame ) = show_stackloc (stdout , frame)
776
777
777
778
# Printing of stacktraces and errors with Frame
778
779
function Base. StackTraces. StackFrame (frame:: Frame )
@@ -821,11 +822,3 @@ function Base.display_error(io::IO, er, frame::Frame)
821
822
showerror (IOContext (io, :limit => true ), er, frame)
822
823
println (io)
823
824
end
824
-
825
- function static_eval (evalmod, ex)
826
- try
827
- Core. eval (evalmod, ex)
828
- catch
829
- nothing
830
- end
831
- end
0 commit comments