Skip to content

Commit 5b2f5a2

Browse files
authored
Merge pull request #8 from JuliaString/spj/fixlookup
Fix lookupname definition
2 parents 9871753 + ae8c681 commit 5b2f5a2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Unicode_Entities.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ __precompile__()
1414
module Unicode_Entities
1515

1616
using StrTables
17+
import StrTables: matchchar, matches, longmatches, _get_strings, _empty_str_vec
1718

1819
struct PackedEntities{S,T} <: AbstractPackedTable{String}
1920
offsetvec::Vector{T}
@@ -106,7 +107,7 @@ function StrTables._get_str(ent::Unicode_Entity, ind)
106107
string(Char(ind <= tab.base32 ? tab.val16[ind] : tab.val32[ind - tab.base32] + 0x10000))
107108
end
108109

109-
StrTables.lookupname(tab::Unicode_Entity, str::AbstractString) =
110+
function StrTables.lookupname(tab::Unicode_Entity, str::AbstractString)
110111
rng = searchsorted(tab.nam, uppercase(str))
111112
isempty(rng) ? StrTables._empty_str : _get_str(tab.tab, tab.tab.ind[rng.start])
112113
end

0 commit comments

Comments
 (0)