Skip to content

Commit dc13050

Browse files
committed
In docs, consider expressions like x.y to be names (fix #11548)
1 parent c85f1be commit dc13050

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

base/docs.jl

Lines changed: 1 addition & 1 deletion
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

Lines changed: 12 additions & 0 deletions
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)