local sid_user = node.subtype 'user_defined'
local node_remove = node.direct.remove
local node_write = node.direct.write
+ local getvalue = node.direct.getdata
+ local setvalue = node.direct.setdata
local GHOST_JACHAR = luatexbase.newuserwhatsitid('ghost of a jachar', 'luatexja')
luatexja.userid_table.GHOST_JACHAR = GHOST_JACHAR
function ltja.create_ghost_jachar_node(cl)
local tn = node_new(id_whatsit, sid_user)
setfield(tn, 'user_id', GHOST_JACHAR)
setfield(tn, 'type', 100)
- setfield(tn, 'value', cl)
+ setvalue(tn, cl)
node_write(tn)
end
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
if Np and Np.nuc then return Np
elseif Np and getfield(lp, 'user_id') == GHOST_JACHAR then
Np.first = lp; Np.nuc = lp; Np.last = lp; Np.class = 0
- if getfield(lp,'value')<2 then
+ if getvalue(lp)<2 then
if Nq and Nq.met then Np.met = Nq.met; else Np.met = get_current_metric(lp) end
Np.pre = 0; Np.post = 0; Np.xspc = 3
else Np.met, Np.pre = nil, nil; end
if not s and getfield(Nq.nuc, 'user_id') == GHOST_JACHAR then
local x, y = node_prev(Nq.nuc), Nq.nuc
Nq.first, Nq.nuc, Nq.last = x, x, x
- if getfield(y,'value')%2==0 then
+ if getvalue(y)%2==0 then
if Np and Nq.met then Nq.met = Np.met; else Nq.met = get_current_metric(y) end
Nq.pre = 0; Nq.post = 0; Nq.xspc = 3
else Nq.met, Nq.pre = nil, nil; end
%% Registers
%\newcount\ltj@tempcnta % defined at luatexja-core.sty
+%\newcount\ltj@tempdima % defined at luatexja-core.sty
\newcount\ltj@tempcntb
\newcount\ltj@tempcntc
-\newdimen\ltj@tempdima
% \newskip\ltj@tempskipa unused
% \newtoks\ltj@temptoks unused
end
local function print_measure()
- stop_time_measure('RUN')
+ stop_time_measure 'RUN'
local temp = {}
for i,v in pairs(time_stat) do
temp[#temp+1] = { i, v[1], v[2], v[2]/v[1] }
luatexbase.add_to_callback('stop_run', print_measure, 'luatexja.time_measure', 1)
luatexbase.add_to_callback('pre_linebreak_filter',
function(p)
- start_time_measure('tex_linebreak'); return p
+ start_time_measure 'tex_linebreak'; return p
end,
'measure_tex_linebreak', 20000)
end
local getlist = dnode.getlist
local getfield = dnode.getfield
local getwhd = dnode.getwhd
+local getvalue = node.direct.getdata
local setfield = dnode.setfield
local setwhd = dnode.setwhd
local setnext = dnode.setnext
local setlist = dnode.setlist
+local setvalue = node.direct.setdata
local node_new = dnode.new
local node_free = dnode.flush_node or dnode.free
end
local shift_old, b_dir, wh = nil, get_box_dir(bh, 0)
if wh then
- dnode.flush_list(getfield(wh, 'value'))
- setfield(wh, 'value', nil)
+ dnode.flush_list(getvalue(wh)); setvalue(wh, nil)
end
return nh, nb, bh, b_dir
end
-- dir_node としてカプセル化されている
local _, dnc = get_box_dir(b, 0)
if dnc then -- free all other dir_node
- dnode.flush_list(getfield(dnc, 'value'))
- setfield(dnc, 'value', nil)
+ dnode.flush_list(getvalue(dnc)); setvalue(dnc, nil)
end
set_attr(b, attr_dir, box_dir%dir_math_mod + dir_node_auto)
return head, node_next(b), b, true
end
box_dir = box_dir%dir_math_mod
local db
- local dnh = getfield(dn, 'value')
+ local dnh = getvalue(dn)
for x in traverse(dnh) do
if get_attr(x, attr_dir)%dir_math_mod == new_dir then
- setfield(dn, 'value', to_node(node_remove(dnh, x)))
+ setvalue(dn, to_node(node_remove(dnh, x)))
db=x; break
end
end
- dnode.flush_list(getfield(dn, 'value'))
- setfield(dn, 'value', nil)
+ dnode.flush_list(getvalue(dn)); setvalue(dn, nil)
db = db or create_dir_node(b, box_dir, new_dir, false)
local w, h, d = getwhd(b)
nh, nb = insert_before(head, b, db), nil
end
local _, wh = get_box_dir(b, 0) -- clean dir_node attached to the box
if wh then
- dnode.flush_list(getfield(wh, 'value'))
- setfield(wh, 'value', nil)
+ dnode.flush_list(getvalue(wh)); setvalue(wh, nil)
end
end
end
-- \wd, \ht, \dp の代わり
do
local getbox, setdimen = tex.getbox, tex.setdimen
+ local ltj_tempdima = luatexbase.registernumber 'ltj@tempdima'
local function get_box_dim_common(key, s, l_dir)
-- s: not dir_node.
local s_dir, wh = get_box_dir(s, dir_yoko)
s_dir = s_dir%dir_math_mod
if s_dir ~= l_dir then
local not_found = true
- for x in traverse(getfield(wh, 'value')) do
+ for x in traverse(getvalue(wh)) do
if l_dir == get_attr(x, attr_dir)%dir_node_auto then
- setdimen('ltj@tempdima', getfield(x, key))
+ setdimen(ltj_tempdima, getfield(x, key))
not_found = false; break
end
end
if not_found then
local w, h, d = getwhd(s)
- setdimen('ltj@tempdima',
- dir_node_aux[s_dir][l_dir][key](w,h,d))
+ setdimen(ltj_tempdima, dir_node_aux[s_dir][l_dir][key](w,h,d))
end
else
- setdimen('ltj@tempdima', getfield(s, key))
+ setdimen(ltj_tempdima, getfield(s, key))
end
end
local function get_box_dim(key, n)
if b_dir<dir_node_auto then
get_box_dim_common(key, s, l_dir)
elseif b_dir%dir_math_mod==l_dir then
- setdimen('ltj@tempdima', getfield(s, key))
+ setdimen(ltj_tempdima, getfield(s, key))
else
get_box_dim_common(key, getlist(s), l_dir)
end
else
- setdimen('ltj@tempdima', 0)
+ setdimen(ltj_tempdima, 0)
end
tex.sprint(cat_lp, '\\ltj@tempdima')
tex.globaldefs = gt
setlist(s, wh)
end
local db
- local dnh = getfield(wh, 'value')
+ local dnh = getvalue(wh)
for x in traverse(dnh) do
if get_attr(x, attr_dir)%dir_node_auto==l_dir then
db = x; break
end
if not db then
db = create_dir_node(s, s_dir, l_dir, true)
- setnext(db, dnh)
- setfield(wh, 'value',to_node(db))
+ setnext(db, dnh); setvalue(wh, to_node(db))
end
setfield(db, key, scan_dimen())
return false
if wh then
-- change dimension of dir_nodes which are created "automatically"
local bw, bh, bd = getwhd(s)
- for x in traverse(getfield(wh, 'value')) do
+ for x in traverse(getvalue(wh)) do
local x_dir = get_attr(x, attr_dir)
if x_dir<dir_node_manual then
local info = dir_node_aux[s_dir][x_dir%dir_node_auto]
end
local setpenalty = node.direct.setpenalty
local setkern = node.direct.setkern
+local call_callback = luatexbase.call_callback
local get_attr = node.direct.get_attribute
local set_attr = node.direct.set_attribute
Np.last_char = npn
if r then
local nf, nc = getfont(npn), getchar(npn)
- local ct = (font.getfont(nf) or font.fonts[nf] ).characters[nc]
+ local ct = (font_getfont(nf) or font.fonts[nf] ).characters[nc]
if not ct then -- variation selector
node_free(r)
elseif (ct.left_protruding or 0) == 0 then
local sid_start_thread = node.subtype 'pdf_start_thread'
local sid_end_link = node.subtype 'pdf_end_link'
local sid_end_thread = node.subtype 'pdf_end_thread'
+local getvalue = node.direct.getdata
calc_np_auxtable = {
[id_glyph] = calc_np_aux_glyph_common,
[id_hlist] = function(lp)
if lps==sid_user then
if getfield(lp, 'user_id')==luatexja.userid_table.IHB then
local lq = node_next(lp);
- head = node_remove(head, lp); node_free(lp); non_ihb_flag = getfield(lp, 'value')~=1
+ head = node_remove(head, lp); node_free(lp); non_ihb_flag = getvalue(lp)~=1
return false, lq;
elseif getfield(lp, 'user_id')==luatexja.userid_table.JA_AL_BDD then
local lq = node_next(lp);
return false, lq;
else
set_attr(lp, attr_icflag, PROCESSED)
- luatexbase.call_callback("luatexja.jfmglue.whatsit_getinfo",
+ call_callback("luatexja.jfmglue.whatsit_getinfo",
Np, lp, Nq)
if Np.nuc then
Np.id = id_pbox_w; Np.first = Np.nuc; Np.last = Np.nuc;
[id_glue] = function(lp)
Np.first, Np.nuc, Np.last = (Np.first or lp), lp, lp;
Np.id = getid(lp);
- local f = luatexbase.call_callback("luatexja.jfmglue.special_jaglue", lp)
+ local f = call_callback("luatexja.jfmglue.special_jaglue", lp)
if f then
set_attr(lp, attr_icflag, PROCESSED)
end
local k
-- We assume lp = node_next(Np.last)
if Nq and Nq.id==id_pbox_w then
- luatexbase.call_callback("luatexja.jfmglue.whatsit_last_minute", false, Nq, Np)
+ call_callback("luatexja.jfmglue.whatsit_last_minute", false, Nq, Np)
end
Np, Nq, non_ihb_flag = Nq, Np, true
-- We clear `predefined' entries of Np before pairs() loop,
-- change penalties (or create a new penalty, if needed)
local function handle_penalty_normal(post, pre, g)
- luatexbase.call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
+ call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
local a = (pre or 0) + (post or 0)
if #Bp == 0 then
if (a~=0 and not(g and getid(g)==id_kern)) then
end
local function handle_penalty_always(post, pre, g)
- luatexbase.call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
+ call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
local a = (pre or 0) + (post or 0)
if #Bp == 0 then
if not (g and getid(g)==id_glue) or a~=0 then
end
local function handle_penalty_suppress(post, pre, g)
- luatexbase.call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
+ call_callback('luatexja.adjust_jfmglue', head, Nq, Np, Bp)
if #Bp == 0 then
if g and getid(g)==id_glue then
local p = node_new(id_penalty, nil, Nq.nuc, Np.nuc)
[id_pbox] = function() after_hlist(Nq) end,
[id_disc] = function() after_hlist(Nq) end,
[id_glue] = function()
- luatexbase.call_callback("luatexja.jfmglue.special_jaglue_after", Nq.nuc)
+ call_callback("luatexja.jfmglue.special_jaglue_after", Nq.nuc)
end,
[id_pbox_w]= function()
- local hh = luatexbase.call_callback("luatexja.jfmglue.whatsit_after", false, Nq, Np, head)
+ local hh = call_callback("luatexja.jfmglue.whatsit_after", false, Nq, Np, head)
-- hh: new head of false (nott processed)
if hh then head = hh end
end,
local BOXB = luatexja.userid_table.BOXB
local node_prev = node.direct.getprev
local node_write = node.direct.write
+ local setvalue = node.direct.setdata
-- \inhibitglue, \disinhibitglue
local function ihb_node(v)
local tn = node_new(id_whatsit, sid_user)
setfield(tn, 'user_id', IHB)
setfield(tn, 'type', 100)
- setfield(tn, 'value', v)
+ setvalue(tn, v)
node_write(tn)
end
function luatexja.jfmglue.create_inhibitglue_node()
local tn = node_new(id_whatsit, sid_user)
setfield(tn, 'user_id', BPAR)
setfield(tn, 'type', 100)
- setfield(tn, 'value', 1)
+ setvalue(tn, 1)
node_write(tn)
end
local tn = node_new(id_whatsit, sid_user)
setfield(tn, 'user_id', BOXB)
setfield(tn, 'type', 100)
- setfield(tn, 'value', 1)
+ setvalue(tn, 1)
node_write(tn)
end
local attr_icflag = luatexbase.attributes['ltj@icflag']
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
local attr_curtfnt = luatexbase.attributes['ltj@curtfnt']
-local id_glyph = node.id('glyph')
-local id_kern = node.id('kern')
+local id_glyph = node.id 'glyph'
+local id_kern = node.id 'kern'
local cat_lp = luatexbase.catcodetables['latex-package']
local FROM_JFM = luatexja.icflag_table.FROM_JFM
local id_glue = node.id 'glue'
local id_penalty = node.id 'penalty'
local id_hlist = node.id 'hlist'
-local setfield = node.direct.setfield
-local getfield = node.direct.getfield
local getlist = node.direct.getlist
local node_new = node.direct.new
local node_prev = node.direct.getprev
if f ~= -1 then
local q = node_new(id_sub_box)
local r = node_new(id_glyph, 256); setnext(r, nil)
- setchar(r, pc); setfont(r, f)
+ setfont(r, f, pc)
local k = get_attr(r,attr_ykblshift) or 0; set_attr(r, attr_ykblshift, 0)
-- ltj-setwidth 内で実際の位置補正はおこなうので,補正量を退避
local met = ltjf_font_metric_table[f]
local getfont = node.direct.getfont
local getchar = node.direct.getchar
local getsubtype = node.direct.getsubtype
+local getvalue = node.direct.getdata
local setchar = node.direct.setchar
local setfont = node.direct.setfont
local setlang = node.direct.setlang
+local setvalue = node.direct.setdata
local to_node = node.direct.tonode
local to_direct = node.direct.todirect
local function append_jglyph(char)
local p = node_new(id_whatsit,sid_user)
setfield(p, 'user_id', OTF); setfield(p, 'type', 100)
- setfield(p, 'value', char); node_write(p)
+ setvalue(p, char); node_write(p)
end
local myutf
local puid = getfield(p, 'user_id')
if puid==OTF then
local g = node_new(id_glyph, 0)
- setchar(g, getfield(p, 'value'))
- setfont(g, get_attr(p, attr_curfnt))
+ setfont(g, get_attr(p, attr_curfnt), getvalue(p))
setlang(g, lang_ja)
set_attr(g, attr_kblshift, get_attr(p, attr_kblshift))
head = node_insert_after(head, p, g)
local node_end_of_math = node.direct.end_of_math
local getcount = tex.getcount
-local id_glyph = node.id('glyph')
-local id_math = node.id('math')
-local id_whatsit = node.id('whatsit')
-local sid_user = node.subtype('user_defined')
+local id_glyph = node.id 'glyph'
+local id_math = node.id 'math'
+local id_whatsit = node.id 'whatsit'
+local sid_user = node.subtype 'user_defined'
local attr_dir = luatexbase.attributes['ltj@dir']
local attr_curjfnt = luatexbase.attributes['ltj@curjfnt']
}
setmetatable(suppress_hyphenate_ja_aux,
{ __index = function() return node_next end, })
- local id_boundary = node.id('boundary')
+ local id_boundary = node.id 'boundary'
local node_new, insert_before = node.direct.new, node.direct.insert_before
local setsubtype = node.direct.setsubtype
local function suppress_hyphenate_ja (h)
- start_time_measure('ltj_hyphenate')
+ start_time_measure 'ltj_hyphenate'
head = to_direct(h)
for i = 1,#wt do wt[i]=nil end
for i = 1,#wtd do wtd[i]=nil end
p = (suppress_hyphenate_ja_aux[pid])(p)
end
end
- stop_time_measure('ltj_hyphenate'); start_time_measure('tex_hyphenate')
+ stop_time_measure 'ltj_hyphenate'; start_time_measure 'tex_hyphenate'
lang.hyphenate(h, nil)
- stop_time_measure('tex_hyphenate')
+ stop_time_measure 'tex_hyphenate'
return h
end
local font_getfont = font.getfont
local traverse_id = node.direct.traverse_id
local cnt_stack = luatexbase.registernumber 'ltj@@stack'
+local texget, getvalue = tex.get, node.direct.getdata
function set_box_stack_level(head, mode)
- local box_set, cl = 0, tex.currentgrouplevel + 1
+ local box_set = 0
if mode then
- for _,p in pairs(wt) do
- if getfield(p, 'value')==cl then box_set = 1 end; node_free(p)
+ local cl = (texget 'currentgrouplevel') + 1
+ for i=1,#wt do
+ local p = wt[i]
+ if getvalue(p)==cl then box_set = 1 end; node_free(p)
end
else
- for _,p in pairs(wt) do node_free(p) end
+ for i=1,#wt do node_free(wt[i]) end
end
ltjs_report_stack_level(getcount(cnt_stack) + box_set)
for _,p in pairs(wtd) do node_free(p) end
--
-- ltj-rmlgbm.lua
--
-luatexja.load_module('base'); local ltjb = luatexja.base
+luatexja.load_module 'base'; local ltjb = luatexja.base
local cidfont_data = {}
local cache_chars = {}
do
local traverse_id, is_node = node.direct.traverse_id, node.is_node
local to_direct = node.direct.todirect
- local id_glyph = node.id('glyph')
+ local id_glyph = node.id 'glyph'
local getfont = node.direct.getfont
local getchar = node.direct.getchar
local setchar = node.direct.setchar
local getheight = node.direct.getheight
local getdepth = node.direct.getdepth
local getwhd = node.direct.getwhd
+local getvalue = node.direct.getdata
local setfield = node.direct.setfield
local setglue = luatexja.setglue
local setkern = node.direct.setkern
local setdepth = node.direct.setdepth
local setwhd = node.direct.setwhd
local setlist = node.direct.setlist
+local setvalue = node.direct.setdata
local node_new = node.direct.new
local node_remove = node.direct.remove
local w = node_new(id_whatsit, sid_user)
setfield(w, 'type', 110); setfield(w, 'user_id', RUBY_PRE)
local wv = node_new(id_whatsit, sid_user)
- setfield(w, 'value', to_node(wv))
setfield(wv, 'type', 108)
- setfield(wv, 'value', rst); rst.count = #rtlr
+ setvalue(w, to_node(wv)); setvalue(wv, rst); rst.count = #rtlr
setfield(wv, 'user_id', RUBY_PRE) -- dummy
local n = wv
for i = 1, #rtlr do
-- kf[i] : container 1--i からなる行末形
-- kf[cmp+i] : container i--cmp からなる行頭形
-- kf[2cmp+1] : 行中形
- local wv = getfield(w, 'value')
- local rst = getfield(wv, 'value')
+ local wv = getvalue(w)
+ local rst = getvalue(wv)
local mdt -- nt*: node temp
local coef = {} -- 連立一次方程式の拡大係数行列
local rtb = expand_3bits(rst.stretch)
local n = first_whatsit(head)
while n do
if getsubtype(n) == sid_user and getfield(n, 'user_id') == RUBY_PRE then
- local nv = getfield(n, 'value')
- local rst = getfield(nv, 'value')
+ local nv = getvalue(n)
+ local rst = getvalue(nv)
max_allow_pre = rst.pre or 0
local atr = get_attr(n, attr_ruby) or 0
if max_allow_pre < 0 then
if #rs ==0 or not rw then return ch end
local hn = get_attr(rs[1], attr_ruby)
local fn = get_attr(rs[#rs], attr_ruby)
- local wv = getfield(rw, 'value')
+ local wv = getvalue(rw)
if hn==1 then
if fn==2*cmp+2 then
local hn = node_tail(wv)
rs[1], rw = ha, nil; ha = node_next(ha)
elseif i==2 then
rw = ha
- cmp = getfield(getfield(rw, 'value'), 'value').count
+ cmp = getvalue(getvalue(rw)).count
local hb, hc = node_remove(getlist(h), rw)
setlist(h, hb); ha = hc
else -- i>=3
rs[1], rw = ha, nil; ha = node_next(ha)
elseif i==2 then
rw = ha
- cmp = getfield(getfield(rw, 'value'), 'value').count
+ cmp = getvalue(getvalue(rw)).count
head, ha = node_remove(head, rw)
else -- i >= 3
rs[#rs+1] = ha; ha = node_next(ha)
if Np.nuc then return Np
elseif getfield(lp, 'user_id') == RUBY_PRE then
Np.first, Np.nuc, Np.last = lp, lp, lp
- local lpv = getfield(lp, 'value')
- local rst = getfield(lpv, 'value')
+ local lpv = getvalue(lp)
+ local rst = getvalue(lpv)
local x = node_next(node_next(lpv))
Np.last_char = luatexja.jfmglue.check_box_high(Np, getlist(x), nil)
if Nq.id ~=id_pbox_w then
Np.first = last_glue
next_cluster_array[Nq.nuc] = last_glue -- ルビ処理用のグルー
end
- local nqnv = getfield(Nq.nuc, 'value')
- local rst = getfield(nqnv, 'value')
+ local nqnv = getvalue(Nq.nuc)
+ local rst = getvalue(nqnv)
if Nq.gk then
if type(Nq.gk)=="table" then
for _,v in ipairs(Nq.gk) do add_gk(rst, 'before_jfmgk', v) end
end
rst.post = p
end
- Np.prev_ruby = get_attr(getfield(Nq.nuc, 'value'), attr_ruby_id)
+ Np.prev_ruby = get_attr(getvalue(Nq.nuc), attr_ruby_id)
-- 前のクラスタがルビであったことのフラグ
else -- 直前が文字以外
- local nqnv = getfield(Nq.nuc, 'value')
- local rst = getfield(nqnv, 'value')
+ local nqnv = getvalue(Nq.nuc)
+ local rst = getvalue(nqnv)
if rst.post < 0 then -- auto
rst.post = 0
end
"luatexja.ruby.np_info_after", 1)
local function w (s, Nq, Np)
if not s and getfield(Nq.nuc, 'user_id') == RUBY_PRE then
- local rst = getfield(getfield(Nq.nuc, 'value'), 'value')
+ local rst = getvalue(getvalue(Nq.nuc))
if Np.gk then
if type(Np.gk)=="table" then
for _,v in ipairs(Np.gk) do add_gk(rst, 'after_jfmgk', v) end
\ltj@curjfnt\m@ne
\ltj@curtfnt\m@ne
-\newcount\ltj@tempcnta
+\newcount\ltj@tempcnta\newdimen\ltj@tempdima
\newcount\ltj@@stack \newcount\ltj@@group@level
\ltj@@group@level\z@\ltj@@stack\z@
'Use lua*tex instead dvilua*tex.')
end
load_module 'rmlgbm'; local ltjr = luatexja.rmlgbm -- must be 1st
-if luatexja_debug then load_module('debug') end
+if luatexja_debug then load_module 'debug' end
load_module 'lotf_aux'; local ltju = luatexja.lotf_aux
load_module 'charrange'; local ltjc = luatexja.charrange
load_module 'stack'; local ltjs = luatexja.stack
if unary_pars[k] then
texwrite(tostring(unary_pars[k](getcount(cnt_stack))))
end
- ltjb.stop_time_measure('get_par')
+ ltjb.stop_time_measure 'get_par'
end
end
if binary_pars[k] then
texwrite(tostring(binary_pars[k](c, getcount(cnt_stack))))
end
- ltjb.stop_time_measure('get_par')
+ ltjb.stop_time_measure 'get_par'
end
end
ensure_tex_attr(attr_icflag, 0)
if gc == 'fin_row' then return head
else
- start_time_measure('jfmglue')
+ start_time_measure 'jfmglue'
slide(head);
local p = ltjj.main(to_direct(head),mode, dir)
- stop_time_measure('jfmglue')
+ stop_time_measure 'jfmglue'
return to_node(p)
end
end
-- lastnodechar
do
local getnest = tex.getnest
- local id_glyph = node.id('glyph')
+ local id_glyph = node.id 'glyph'
function luatexja.pltx_composite_last_node_char()
local n = getnest()
local r = '-1'
local node_next = node.next
local get_attr = node.get_attribute
-local id_penalty = node.id('penalty')
-local id_glyph = node.id('glyph')
-local id_glue = node.id('glue')
-local id_kern = node.id('kern')
-local id_hlist = node.id('hlist')
-local id_vlist = node.id('vlist')
-local id_rule = node.id('rule')
-local id_math = node.id('math')
-local id_whatsit = node.id('whatsit')
-local sid_user = node.subtype('user_defined')
+local id_penalty = node.id 'penalty'
+local id_glyph = node.id 'glyph'
+local id_glue = node.id 'glue'
+local id_kern = node.id 'kern'
+local id_hlist = node.id 'hlist'
+local id_vlist = node.id 'vlist'
+local id_rule = node.id 'rule'
+local id_math = node.id 'math'
+local id_whatsit = node.id 'whatsit'
+local sid_user = node.subtype 'user_defined'
local prefix, inner_depth
local utfchar = utf.char