/usr/share/julia/base/docs/bootstrap.jl is in julia-common 0.4.7-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | # This file is a part of Julia. License is MIT: http://julialang.org/license
macro doc(args...)
DocBootstrap._expand_(args...)
end
macro __doc__(ex) esc(Expr(:block, symbol("#doc#"), ex)) end
module DocBootstrap
type List
head
tail
end
docs = nothing
_expand_ = nothing
setexpand!(f) = global _expand_ = f
function __bootexpand(str, obj)
global docs = List((ccall(:jl_get_current_module, Any, ()), str, obj), docs)
(isa(obj, Expr) && obj.head === :call) && return nothing
(isa(obj, Expr) && obj.head === :module) && return esc(Expr(:toplevel, obj))
esc(obj)
end
function __bootexpand(expr::Expr)
if expr.head !== :->
throw(ArgumentError("Wrong argument to @doc"))
end
__bootexpand(expr.args...)
end
setexpand!(__bootexpand)
"""
DocBootstrap :: Module
Basic docstring bootstrapping module that accumulates docstrings prior to the real docsystem
being defined in `base/docs/Docs.jl`. Once the proper docsystem is loaded all docstrings
that were stored in `DocBootstrap.docs` are migrated to their correct modules using
`DocBootstrap.loaddocs()`.
"""
DocBootstrap
"""
loaddocs()
Move all docstrings from `DocBootstrap.docs` to their module's `__META__` dict.
"""
function loaddocs()
node = docs
while node ≠ nothing
mod, str, obj = node.head
eval(mod, :(Base.@doc($str, $obj, false)))
node = node.tail
end
global docs = nothing
end
end
|