Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ ncodeunits(c::ANSIDelimiter) = ncodeunits(c.del)
textwidth(::ANSIDelimiter) = 0

# An iterator similar to `pairs(::String)` but whose values are Char or ANSIDelimiter
struct ANSIIterator
captures::RegexMatchIterator
struct ANSIIterator{S}
captures::RegexMatchIterator{S}
end
ANSIIterator(s::AbstractString) = ANSIIterator(eachmatch(ansi_regex, s))

IteratorSize(::Type{ANSIIterator}) = SizeUnknown()
eltype(::Type{ANSIIterator}) = Pair{Int, Union{Char,ANSIDelimiter}}
IteratorSize(::Type{<:ANSIIterator}) = SizeUnknown()
eltype(::Type{<:ANSIIterator}) = Pair{Int, Union{Char,ANSIDelimiter}}
function iterate(I::ANSIIterator, (i, m_st)=(1, iterate(I.captures)))
m_st === nothing && return nothing
m, (j, new_m_st) = m_st
Expand Down