X-Git-Url: http://git.osdn.jp/view?a=blobdiff_plain;f=src%2Fluatexja.lua;h=940ed213525d9180ca9a304f600b937a72bab51f;hb=eb118f3e5ea0852407b5261817700401699528b9;hp=3d834010fa84640daa0b4b93e417fd0bdbfa1abf;hpb=c7058402b4897aeb375eac689126792230877344;p=luatex-ja%2Fluatexja.git diff --git a/src/luatexja.lua b/src/luatexja.lua index 3d83401..940ed21 100644 --- a/src/luatexja.lua +++ b/src/luatexja.lua @@ -1,5 +1,6 @@ require('lualibs') +tableunpack = table.unpack ------------------------------------------------------------------------ -- naming: @@ -19,6 +20,16 @@ function luatexja.load_lua(fn) end end +-- check token library +if newtoken then + luatexja.token = newtoken +else + local luatex_version = status.list().luatex_version + if luatex_version >80 then + luatexja.token = token + end +end + --- 以下は全ファイルで共有される定数 local icflag_table = {} luatexja.icflag_table = icflag_table @@ -284,8 +295,6 @@ do local nullfunc = function (n) return n end local to_node = (Dnode ~= node) and Dnode.tonode or nullfunc local to_direct = (Dnode ~= node) and Dnode.todirect or nullfunc - local tex_set_attr = tex.setattribute - local tex_get_attr, node_copy = tex.getattribute, Dnode.copy local ensure_tex_attr = ltjb.ensure_tex_attr -- mode = true iff main_process is called from pre_linebreak_filter @@ -328,6 +337,13 @@ do end +-- cleanup process +function luatexja.ext_cleanup() + ltjf.cleanup_size_cache() + ltjd.remove_end_whatsit() +end + + -- debug do