Skip to content

Commit

Permalink
prepare for macrocall having a source location argument
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed May 10, 2017
1 parent 459116c commit ade269e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/DocSystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ binding(m::Module, λ::Any) = binding(λ)

function signature(x, str::AbstractString)
ts = Base.Docs.signature(x)
(Meta.isexpr(x, :macrocall, 1 + Compat.macros_have_sourceinfo) && !endswith(strip(str), "()")) ? :(Union{}) : ts
(Meta.isexpr(x, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(strip(str), "()")) ? :(Union{}) : ts
end
if VERSION < v"0.5.0-dev"
Base.Docs.signature(::Any) = :(Union{})
Expand Down
4 changes: 2 additions & 2 deletions src/Utilities/Utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ Returns a expression that, when evaluated, returns an [`Object`](@ref) represent
function object(ex::Union{Symbol, Expr}, str::AbstractString)
binding = Expr(:call, Binding, splitexpr(Docs.namify(ex))...)
signature = Base.Docs.signature(ex)
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceinfo) && !endswith(str, "()") && (signature = :(Union{}))
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(str, "()") && (signature = :(Union{}))
Expr(:call, Object, binding, signature)
end

Expand Down Expand Up @@ -275,7 +275,7 @@ if VERSION < v"0.5-"
end
else
function docs(ex::Union{Symbol, Expr}, str::AbstractString)
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceinfo) && !endswith(rstrip(str), "()") && (ex = quot(ex))
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(rstrip(str), "()") && (ex = quot(ex))
:(Base.Docs.@doc $ex)
end
end
Expand Down

0 comments on commit ade269e

Please sign in to comment.