Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Julia: fix filename quoting in docstring #13894

Merged
merged 1 commit into from
Jan 19, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions julia/src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,14 @@ end
Extract the line of `Defined in ...`

julia> mx._getdocdefine("sgd_update")
"Defined in src/operator/optimizer_op.cc:L53"
```
"Defined in `src/operator/optimizer_op.cc:L53`"
"""
function _getdocdefine(name::String)
op = _get_libmx_op_handle(name)
str = _get_libmx_op_description(name, op)[1]
lines = split(str, '\n')
for m ∈ match.(Ref(r"^Defined in .*$"), lines)
m != nothing && return m.match
for m ∈ match.(Ref(r"^Defined in ([\S]+)$"), lines)
m != nothing && return "Defined in `$(m.captures[1])`"
end
""
end
Expand Down