--
luatexbase.provides_module({
name = 'luatexja.charrange',
- date = '2014/01/19',
+ date = '2014/05/08',
description = 'Handling the range of Japanese characters',
})
module('luatexja.charrange', package.seeall)
local tex_getattr = tex.getattribute
ATTR_RANGE = 7
+local jcr_cjk, jcr_noncjk = 0, 1
local floor = math.floor
local pow = math.pow
local kcat_attr_table = {}
-- initialize
jcr_table_main = {}
local jcr_table_main = jcr_table_main
-local jcr_cjk = 0; local jcr_noncjk = 1; local ucs_out = 0x110000
+local ucs_out = 0x110000
for i=0x80 ,0xFF do jcr_table_main[i]=1 end
for i=0x100,ucs_out-1 do jcr_table_main[i]=0 end
function char_to_range(c) -- return the external range number
c=ltjb.in_unicode(c, false)
if c<0x80 then return -1
- else
+ else
local r = jcr_table_main[c] or 217
- return (r and r~=0) and r or 217
+ return (r and r~=0) and r or 217
end
end
if c<0x80 then
return false
else
- return fn_table[jcr_table_main[c]]
+ return fn_table[jcr_table_main[c]](p)
end
end