Skip to content

Commit ce90a6d

Browse files
committed
Merge pull request #11550 from fcard/patch-2
In docs, consider expressions like `x.y` to be names (fix #11548)
2 parents 7e4f148 + dc13050 commit ce90a6d

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

base/docs.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ end
150150

151151
uncurly(ex) = isexpr(ex, :curly) ? ex.args[1] : ex
152152

153-
namify(ex::Expr) = namify(ex.args[1])
153+
namify(ex::Expr) = isexpr(ex, :.)? ex : namify(ex.args[1])
154154
namify(sy::Symbol) = sy
155155

156156
function mdify(ex)

test/docs.jl

+12
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,15 @@ macro macro_doctest() end
88
@doc "Helps test if macros can be documented with `@doc \"...\" -> @...`." ->
99
@macro_doctest
1010
@test (@doc @macro_doctest) != nothing
11+
12+
# issue #11548
13+
14+
module ModuleMacroDoc
15+
macro m() end
16+
end
17+
18+
@doc ("I am a module";) ModuleMacroDoc
19+
@doc ("I am a macro";) ModuleMacroDoc.@m
20+
21+
@test (@doc ModuleMacroDoc) == "I am a module"
22+
@test (@doc ModuleMacroDoc.@m) == "I am a macro"

0 commit comments

Comments
 (0)