-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drop Tectonic and EndpointRanges, add tectonic_jll
Signed-off-by: Stefan Krastanov <stefan@krastanov.org>
- Loading branch information
Showing
4 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
name = "Quantikz" | ||
uuid = "b0d11df0-eea3-4d79-b4a5-421488cbf74b" | ||
authors = ["Stefan Krastanov <stefan@krastanov.org>"] | ||
version = "1.1.2" | ||
version = "1.1.3" | ||
|
||
[deps] | ||
EndpointRanges = "340492b5-2a47-5f55-813d-aca7ddf97656" | ||
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" | ||
Ghostscript_jll = "61579ee1-b43e-5ca0-a5da-69d92c66a64b" | ||
ImageMagick = "6218d12a-5da1-5696-b52f-db25d2ecc6d1" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
Tectonic = "9ac5f52a-99c6-489f-af81-462ef484790f" | ||
tectonic_jll = "d7dd28d6-a5e6-559c-9131-7eb760cdacc5" | ||
|
||
|
||
[compat] | ||
EndpointRanges = "0.2" | ||
FileIO = "1.6" | ||
Ghostscript_jll = "9.53" | ||
ImageMagick = "1.1" | ||
Tectonic = "0.8" | ||
julia = "1.3" | ||
julia = "1.6" | ||
tectonic_jll = "0.11" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
# copied from https://github.com/JuliaArrays/EndpointRanges.jl | ||
# due to the fact that Quantikz was the only dependent of EndpointRanges | ||
# causing some worry about the support that would be available upstream | ||
module VendoredEndpointRanges | ||
|
||
import Base: +, -, *, /, ÷, % | ||
using Base: ViewIndex, tail, axes1 | ||
|
||
export ibegin, iend | ||
|
||
abstract type Endpoint end | ||
struct IBegin <: Endpoint end | ||
struct IEnd <: Endpoint end | ||
const ibegin = IBegin() | ||
const iend = IEnd() | ||
|
||
(::IBegin)(b::Integer, e::Integer) = b | ||
(::IEnd )(b::Integer, e::Integer) = e | ||
(::IBegin)(r::AbstractRange) = first(r) | ||
(::IEnd )(r::AbstractRange) = last(r) | ||
|
||
struct IndexFunction{F<:Function} <: Endpoint | ||
index::F | ||
end | ||
(f::IndexFunction)(r::AbstractRange) = f.index(r) | ||
|
||
for op in (:+, :-) | ||
@eval $op(x::Endpoint) = IndexFunction(r->x(r)) | ||
end | ||
for op in (:+, :-, :*, :/, :÷, :%) | ||
@eval $op(x::Endpoint, y::Endpoint) = IndexFunction(r->$op(x(r), y(r))) | ||
@eval $op(x::Endpoint, y::Number) = IndexFunction(r->$op(x(r), y)) | ||
@eval $op(x::Number, y::Endpoint) = IndexFunction(r->$op(x, y(r))) | ||
end | ||
|
||
# deliberately not <: AbstractUnitRange{Int} | ||
abstract type EndpointRange{T} end | ||
struct EndpointUnitRange{F<:Union{Int,Endpoint},L<:Union{Int,Endpoint}} <: EndpointRange{Int} | ||
start::F | ||
stop::L | ||
end | ||
struct EndpointStepRange{F<:Union{Int,Endpoint},L<:Union{Int,Endpoint}} <: EndpointRange{Int} | ||
start::F | ||
step::Int | ||
stop::L | ||
end | ||
|
||
(r::EndpointUnitRange)(s::AbstractRange) = r.start(s):r.stop(s) | ||
(r::EndpointUnitRange{Int,E})(s::AbstractRange) where {E<:Endpoint} = r.start:r.stop(s) | ||
(r::EndpointUnitRange{E,Int})(s::AbstractRange) where {E<:Endpoint} = r.start(s):r.stop | ||
|
||
(r::EndpointStepRange)(s::AbstractRange) = r.start(s):r.step:r.stop(s) | ||
(r::EndpointStepRange{Int,E})(s::AbstractRange) where {E<:Endpoint} = r.start:r.step:r.stop(s) | ||
(r::EndpointStepRange{E,Int})(s::AbstractRange) where {E<:Endpoint} = r.start(s):r.step:r.stop | ||
|
||
(::Colon)(start::Endpoint, stop::Endpoint) = EndpointUnitRange(start, stop) | ||
(::Colon)(start::Endpoint, stop::Int) = EndpointUnitRange(start, stop) | ||
(::Colon)(start::Int, stop::Endpoint) = EndpointUnitRange(start, stop) | ||
|
||
(::Colon)(start::Endpoint, step::Int, stop::Endpoint) = EndpointStepRange(start, step, stop) | ||
(::Colon)(start::Endpoint, step::Int, stop::Int) = EndpointStepRange(start, step, stop) | ||
(::Colon)(start::Int, step::Int, stop::Endpoint) = EndpointStepRange(start, step, stop) | ||
|
||
function Base.getindex(r::UnitRange, s::EndpointRange) | ||
getindex(r, newindex(axes1(r), s)) | ||
end | ||
|
||
function Base.getindex(r::AbstractUnitRange, s::EndpointRange) | ||
getindex(r, newindex(axes1(r), s)) | ||
end | ||
|
||
function Base.getindex(r::StepRange, s::EndpointRange) | ||
getindex(r, newindex(axes1(r), s)) | ||
end | ||
|
||
function Base.getindex(r::StepRangeLen, s::EndpointRange) | ||
getindex(r, newindex(axes1(r), s)) | ||
end | ||
|
||
function Base.getindex(r::LinRange, s::EndpointRange) | ||
getindex(r, newindex(axes1(r), s)) | ||
end | ||
|
||
|
||
@inline function Base.to_indices(A, inds, I::Tuple{Union{Endpoint, EndpointRange}, Vararg{Any}}) | ||
(newindex(inds[1], I[1]), to_indices(A, (inds)[2:end], Base.tail(I))...) | ||
end | ||
|
||
@inline newindices(indsA, inds) = (newindex(indsA[1], inds[1]), newindices(tail(indsA), tail(inds))...) | ||
newindices(::Tuple{}, ::Tuple{}) = () | ||
|
||
newindex(indA, i::Union{Real, AbstractArray, Colon}) = i | ||
newindex(indA, i::EndpointRange) = i(indA) | ||
newindex(indA, i::IBegin) = first(indA) | ||
newindex(indA, i::IEnd) = last(indA) | ||
newindex(indA, i::Endpoint) = i(indA) | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters