/
githubmirror
/
julia
Обзор
Документация
Войти
/
githubmirror
/
julia
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
base/docs/core.jl
39 строк
1 KB
Shuhei Kadowaki
Base: Remove unused imports flagged by JETLS (#62533)
29 июл 2026, 07:47
Не верифицирован
29 июл 2026, 07:47
217090f
Код
Авторство
О чём код?
# This file is a part of Julia. License is MIT: https://julialang.org/license module CoreDocs import Core: SimpleVector struct DocLinkedList doc::SimpleVector next::DocLinkedList DocLinkedList() = new() DocLinkedList(doc::SimpleVector, next::DocLinkedList) = new(doc, next) end global DOCS = DocLinkedList() function doc!(source::LineNumberNode, mod::Module, str, ex) global DOCS DOCS = DocLinkedList(Core.svec(mod, ex, str, source.file, source.line), DOCS) nothing end isexpr(x, h::Symbol) = 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(source::LineNumberNode, mod::Module, str, x) out = Expr(:call, doc!, QuoteNode(source), mod, lazy_iterpolate(str), QuoteNode(x)) if isexpr(x, :module) out = Expr(:toplevel, out, x) elseif isexpr(x, :call) else out = Expr(:block, x, out) end return Expr(:escape, out) end docm(source::LineNumberNode, mod::Module, x) = (isa(x, Expr) && x.head === :->) ? docm(source, mod, x.args[1], x.args[2].args[2]) : error("invalid '@doc'.") end