Skip to content

Commit 27e8059

Browse files
vtjnashmortenpi
authored andcommitted
prepare for macrocall having a source location argument
JuliaLang/julia#21746
1 parent 6445adc commit 27e8059

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

REQUIRE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
julia 0.5
2-
Compat 0.17
2+
Compat 0.25
33
DocStringExtensions 0.2

src/DocSystem.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ binding(m::Module, λ::Any) = binding(λ)
8888

8989
function signature(x, str::AbstractString)
9090
ts = Base.Docs.signature(x)
91-
(Meta.isexpr(x, :macrocall, 1) && !endswith(strip(str), "()")) ? :(Union{}) : ts
91+
(Meta.isexpr(x, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(strip(str), "()")) ? :(Union{}) : ts
9292
end
9393
if VERSION < v"0.5.0-dev"
9494
Base.Docs.signature(::Any) = :(Union{})

src/Utilities/Utilities.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ Returns a expression that, when evaluated, returns an [`Object`](@ref) represent
238238
function object(ex::Union{Symbol, Expr}, str::AbstractString)
239239
binding = Expr(:call, Binding, splitexpr(Docs.namify(ex))...)
240240
signature = Base.Docs.signature(ex)
241-
isexpr(ex, :macrocall, 1) && !endswith(str, "()") && (signature = :(Union{}))
241+
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(str, "()") && (signature = :(Union{}))
242242
Expr(:call, Object, binding, signature)
243243
end
244244

@@ -275,7 +275,7 @@ if VERSION < v"0.5-"
275275
end
276276
else
277277
function docs(ex::Union{Symbol, Expr}, str::AbstractString)
278-
isexpr(ex, :macrocall, 1) && !endswith(rstrip(str), "()") && (ex = quot(ex))
278+
isexpr(ex, :macrocall, 1 + Compat.macros_have_sourceloc) && !endswith(rstrip(str), "()") && (ex = quot(ex))
279279
:(Base.Docs.@doc $ex)
280280
end
281281
end

0 commit comments

Comments
 (0)