Skip to content

Commit 575bbbe

Browse files
authored
Merge pull request #2 from JuliaString/spj/v7update
Updates for v0.7
2 parents 0b1cea3 + 83a7e5b commit 575bbbe

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/HTML_Entities.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ using StrTables
1212

1313
VER = UInt32(1)
1414

15-
immutable HTML_Table{T} <: AbstractEntityTable
15+
struct HTML_Table{T} <: AbstractEntityTable
1616
ver::UInt32
1717
tim::String
1818
inf::String
@@ -44,7 +44,7 @@ function _get_str(ind)
4444
string(Char(val>>>16), Char(val&0xffff))
4545
end
4646

47-
function _get_strings{T}(val::T, tab::Vector{T}, ind::Vector{UInt16})
47+
function _get_strings(val::T, tab::Vector{T}, ind::Vector{UInt16}) where {T}
4848
rng = searchsorted(tab, val)
4949
isempty(rng) && return _empty_str_vec
5050
_tab.nam[ind[rng]]
@@ -55,10 +55,11 @@ function lookupname(str::AbstractString)
5555
isempty(rng) ? _empty_str : _get_str(_tab.ind[rng.start])
5656
end
5757

58-
matchchar(ch::Char) =
59-
(ch <= '\uffff'
58+
matchchar(ch::UInt32) =
59+
(ch <= 0x0ffff
6060
? _get_strings(ch%UInt16, _tab.val16, _tab.ind16)
61-
: (ch <= '\U1ffff' ? _get_strings(ch%UInt16, _tab.val32, _tab.ind32) : _empty_str_vec))
61+
: (ch <= 0x1ffff ? _get_strings(ch%UInt16, _tab.val32, _tab.ind32) : _empty_str_vec))
62+
matchchar(ch::Char) = matchchar(UInt32(ch))
6263

6364
matches(str::AbstractString) = matches(convert(Vector{Char}, str))
6465
function matches(vec::Vector{Char})

0 commit comments

Comments
 (0)