Skip to content

Commit

Permalink
Update Parser.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Nov 4, 2018
1 parent 3747b4a commit 765feed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ mutable struct MemoryParserState <: ParserState
s::Int
utf8array::PushVector{UInt8, Vector{UInt8}}
end
MemoryParserState(str::AbstractString) = MemoryParserState(str, 1, PushVector{UInt8}())

# it is convenient to access MemoryParserState like a Vector{UInt8} to avoid copies
MemoryParserState(str::AbstractString) = MemoryParserState(str, 1, PushVector{UInt8}())
Base.@propagate_inbounds Base.getindex(state::MemoryParserState, i::Int) = codeunit(state.utf8, i)
Base.length(state::MemoryParserState) = sizeof(state.utf8)
Base.unsafe_convert(::Type{Ptr{UInt8}}, state::MemoryParserState) = unsafe_convert(Ptr{UInt8}, state.utf8)
Expand Down

0 comments on commit 765feed

Please sign in to comment.