Skip to content

Commit

Permalink
fix #9 _iterate(::Bytes,sequence,till,...) check whether number of by…
Browse files Browse the repository at this point in the history
…tes available
  • Loading branch information
gkappler committed Aug 19, 2020
1 parent 6fb562a commit 7707b8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CombinedParsers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ struct Bytes{T} <: CombinedParser{MatchState,T}
end
Bytes(N::Integer, T::Type=Char) = Bytes{T}(N)
_iterate(parser::Bytes, sequence, till, posi, next_i, state::Nothing) =
nextind(sequence,posi,parser.N), MatchState()
posi+parser.N <= till ? (nextind(sequence,posi,parser.N), MatchState()) : nothing
_iterate(parser::Bytes, sequence, till, posi, next_i, state::MatchState) =
nothing
regex_string_(x::Bytes{N}) where N = ".{$(N)}"
Expand Down

0 comments on commit 7707b8b

Please sign in to comment.