Skip to content

Commit

Permalink
Eliminate use of undocumented Base.utf16_* functions (Fix #110)
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottPJones committed Jul 1, 2015
1 parent e583641 commit 91688c2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,8 @@ function parse_object{T<:AbstractString}(ps::ParserState{T}, ordered::Bool, obj)
return obj
end

if VERSION <= v"0.3-"
utf16_is_surrogate(c::Uint16) = (c & 0xf800) == 0xd800
utf16_get_supplementary(lead::Uint16, trail::Uint16) = char((lead-0xd7f7)<<10 + trail)
else
const utf16_is_surrogate = Base.utf16_is_surrogate
const utf16_get_supplementary = Base.utf16_get_supplementary
end
utf16_is_surrogate(c::Uint16) = (c & 0xf800) == 0xd800
utf16_get_supplementary(lead::Uint16, trail::Uint16) = Char((UInt32(lead-0xd7f7)<<10) + trail)

# TODO: Try to find ways to improve the performance of this (currently one
# of the slowest parsing methods).
Expand Down

0 comments on commit 91688c2

Please sign in to comment.