1
0
Fork 0
mirror of https://github.com/MillironX/XAM.jl.git synced 2024-11-14 22:33:14 +00:00

Quick fix for BioCore.Ragel.State

This fix is likely to be replaced when migrating to TranscodingStreams.
This commit is contained in:
Ciarán O'Mara 2019-08-27 08:52:35 +10:00
parent 2cad552f63
commit c59a157675
2 changed files with 17 additions and 2 deletions

View file

@ -2,11 +2,11 @@
# ========= # =========
mutable struct Reader <: BioGenerics.IO.AbstractReader mutable struct Reader <: BioGenerics.IO.AbstractReader
state::BioGenerics.Ragel.State state::State
header::Header header::Header
function Reader(input::BufferedStreams.BufferedInputStream) function Reader(input::BufferedStreams.BufferedInputStream)
reader = new(BioGenerics.Ragel.State(sam_header_machine.start_state, input), Header()) reader = new(State(sam_header_machine.start_state, input), Header())
readheader!(reader) readheader!(reader)
reader.state.cs = sam_body_machine.start_state reader.state.cs = sam_body_machine.start_state
return reader return reader

View file

@ -46,6 +46,21 @@ function unsafe_parse_decimal(::Type{T}, data::Vector{UInt8}, range::UnitRange{I
return sign * x return sign * x
end end
#TODO: update BioCore.Ragel.State (will likely change with TrnscodingStreams).
import BufferedStreams: BufferedStreams, BufferedInputStream
# A type keeping track of a ragel-based parser's state.
mutable struct State{T<:BufferedInputStream}
stream::T # input stream
cs::Int # current DFA state of Ragel
linenum::Int # line number: parser is responsible for updating this
finished::Bool # true if finished (regardless of where in the stream we are)
end
function State(initstate::Int, input::BufferedInputStream)
return State(input, initstate, 1, false)
end
include("flags.jl") include("flags.jl")
include("metainfo.jl") include("metainfo.jl")
include("record.jl") include("record.jl")