fix incorrect folder name for julia-0.6.x
Former-commit-id: ef2c7401e0876f22d2f7762d182cfbcd5a7d9c70
This commit is contained in:
28
julia-0.6.3/share/julia/base/docs/core.jl
Normal file
28
julia-0.6.3/share/julia/base/docs/core.jl
Normal file
@@ -0,0 +1,28 @@
|
||||
# This file is a part of Julia. License is MIT: https://julialang.org/license
|
||||
|
||||
module CoreDocs
|
||||
|
||||
import ..esc, ..push!, ..getindex, ..current_module, ..unsafe_load, ..Csize_t
|
||||
|
||||
function doc!(str, ex)
|
||||
ptr = unsafe_load(Core.Intrinsics.cglobal(:jl_filename, Ptr{UInt8}))
|
||||
len = ccall(:strlen, Csize_t, (Ptr{UInt8},), ptr)
|
||||
file = ccall(:jl_symbol_n, Any, (Ptr{UInt8}, Csize_t), ptr, len)
|
||||
line = unsafe_load(Core.Intrinsics.cglobal(:jl_lineno, Int32)) # Cint
|
||||
push!(DOCS, (current_module(), ex, str, file, line))
|
||||
end
|
||||
const DOCS = Array{Any, 1}()
|
||||
|
||||
isexpr(x, h) = isa(x, Expr) && x.head === h
|
||||
|
||||
lazy_iterpolate(s::AbstractString) = Expr(:call, Core.svec, s)
|
||||
lazy_iterpolate(x) = isexpr(x, :string) ? Expr(:call, Core.svec, x.args...) : x
|
||||
|
||||
function docm(str, x)
|
||||
out = esc(Expr(:call, doc!, lazy_iterpolate(str), Expr(:quote, x)))
|
||||
isexpr(x, :module) ? Expr(:toplevel, out, esc(x)) :
|
||||
isexpr(x, :call) ? out : Expr(:block, esc(x), out)
|
||||
end
|
||||
docm(x) = isexpr(x, :->) ? docm(x.args[1], x.args[2].args[2]) : error("invalid '@doc'.")
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user