Skip to content

Commit 07ced46

Browse files
committed
Add doc_str and doc macros, to support Base.Docs/Docile syntax.
1 parent 5f534b0 commit 07ced46

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ Currently, the `@compat` macro supports the following syntaxes:
109109

110110
* `@inline` and `@noinline` have been added. On 0.3, these are "no-ops," meaning they don't actually do anything.
111111

112+
* `@doc`, `@doc_str` and `@doc_mstr` have been added. On 0.3 if Docile is available it will use its definitions, else these are no-ops.
113+
112114
## Other changes
113115

114116
* `Dict(ks, vs)` is now `Dict(zip(ks, vs))` [#8521](https://github.com/JuliaLang/julia/pull/8521)

src/Compat.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ if VERSION < v"0.4.0-dev+412"
3838
eval(Base, :(const IPAddr = IpAddr))
3939
end
4040

41+
if VERSION < v"0.4.0-dev+1501"
42+
try
43+
import Docile: @doc_str, @doc_mstr, @doc
44+
catch
45+
macro doc_str(x) x end
46+
macro doc_mstr(x) x end
47+
macro doc(ex) esc(ex.args[end]) end
48+
end
49+
end
50+
4151
if VERSION < v"0.4.0-dev+2197"
4252
Base.IPv4(ipstr::AbstractString) = Base.parseipv4(ipstr)
4353
Base.IPv6(ipstr::AbstractString) = Base.parseipv6(ipstr)

0 commit comments

Comments
 (0)