From e9d6eb7297946dac4b33ffc33df670fb1aab92e0 Mon Sep 17 00:00:00 2001 From: "Ben J. Ward" Date: Tue, 14 Aug 2018 23:07:47 +0100 Subject: [PATCH] Comment out some lines of Ragel.jl With a view to completely removing them later, I don't think they are used in BioJulia codebases anymore. --- src/Ragel.jl | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/src/Ragel.jl b/src/Ragel.jl index 5852371..eee24bf 100644 --- a/src/Ragel.jl +++ b/src/Ragel.jl @@ -12,7 +12,7 @@ export tryread! import BioCore.IO: FileFormat, AbstractReader, stream import BufferedStreams: BufferedStreams, BufferedInputStream -using Nullables +#using Nullables # A type keeping track of a ragel-based parser's state. mutable struct State{T<:BufferedInputStream} @@ -26,6 +26,7 @@ function State(initstate::Int, input::BufferedInputStream) return State(input, initstate, 1, false) end +#= @inline function anchor!(stream, p) stream.anchor = 1 + p end @@ -228,13 +229,13 @@ end function Base.read(input::AbstractReader) return read!(input, eltype(input)()) end - +=# """ tryread!(reader::AbstractReader, output) Try to read the next element into `output` from `reader`. -The result is wrapped in `Nullable` and will be null if no entry is available. +If the result could not be read, then `nothing` will be returned instead. """ function tryread!(reader::AbstractReader, output) T = eltype(reader) @@ -261,28 +262,4 @@ function Base.iterate(reader::AbstractReader, nextone = eltype(reader)()) end end -#= -function Base.start(reader::AbstractReader) - T = eltype(reader) - nextone = T() - if isnull(tryread!(reader, nextone)) - return Nullable{T}() - else - return Nullable{T}(nextone) - end -end - -Base.done(reader::AbstractReader, nextone) = isnull(nextone) - -function Base.next(reader::AbstractReader, nextone) - item = get(nextone) - ret = copy(item) - if isnull(tryread!(reader, item)) - return ret, Nullable{eltype(reader)}() - else - return ret, Nullable(item) - end -end -=# - end # module Ragel