OSDN Git Service

use node.direct.{g/s}etdata
authorHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 23 Aug 2022 21:09:11 +0000 (06:09 +0900)
committerHironori Kitagawa <h_kitagawa2001@yahoo.co.jp>
Tue, 23 Aug 2022 21:09:11 +0000 (06:09 +0900)
14 files changed:
src/ltj-adjust.lua
src/ltj-base.sty
src/ltj-debug.lua
src/ltj-direction.lua
src/ltj-jfmglue.lua
src/ltj-jfont.lua
src/ltj-lineskip.lua
src/ltj-math.lua
src/ltj-otf.lua
src/ltj-pretreat.lua
src/ltj-rmlgbm.lua
src/ltj-ruby.lua
src/luatexja-core.sty
src/luatexja.lua

index af5c5ca..568e123 100644 (file)
@@ -562,13 +562,15 @@ do
   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']
@@ -585,7 +587,7 @@ do
     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
@@ -598,7 +600,7 @@ do
     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
index d46b54a..ba88ec9 100644 (file)
@@ -20,9 +20,9 @@
 
 %% 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
 
index b9ebcae..9122426 100644 (file)
@@ -105,7 +105,7 @@ do
    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] }
@@ -123,7 +123,7 @@ do
       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
index 1a7364a..5321f23 100644 (file)
@@ -22,10 +22,12 @@ local getsubtype = dnode.getsubtype
 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
@@ -614,8 +616,7 @@ local function unwrap_dir_node(b, head, box_dir)
    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
@@ -664,8 +665,7 @@ do
             -- 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
@@ -687,15 +687,14 @@ do
          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
@@ -747,8 +746,7 @@ do
             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
@@ -762,25 +760,25 @@ 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)
@@ -793,12 +791,12 @@ do
          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
@@ -817,7 +815,7 @@ do
             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
@@ -825,8 +823,7 @@ do
          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
@@ -835,7 +832,7 @@ do
          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]
index 822154e..eb1834d 100644 (file)
@@ -42,6 +42,7 @@ do
 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
@@ -402,7 +403,7 @@ function calc_np_aux_glyph_common(lp, acc_flag)
          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
@@ -434,6 +435,7 @@ local sid_start_link   = node.subtype 'pdf_start_link'
 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)
@@ -466,7 +468,7 @@ calc_np_auxtable = {
       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);
@@ -474,7 +476,7 @@ calc_np_auxtable = {
             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;
@@ -507,7 +509,7 @@ calc_np_auxtable = {
    [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
@@ -557,7 +559,7 @@ function calc_np(last, lp)
    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,
@@ -694,7 +696,7 @@ luatexbase.create_callback('luatexja.adjust_jfmglue', 'simple', function(n) retu
 
 -- 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
@@ -708,7 +710,7 @@ local function handle_penalty_normal(post, pre, g)
 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
@@ -722,7 +724,7 @@ local function handle_penalty_always(post, pre, g)
 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)
@@ -1113,10 +1115,10 @@ do
       [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,
@@ -1279,13 +1281,14 @@ do
    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()
@@ -1301,7 +1304,7 @@ do
       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
 
@@ -1310,7 +1313,7 @@ do
       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
 
index 28e21dd..a14edd2 100644 (file)
@@ -28,8 +28,8 @@ local setkern = node.direct.setkern
 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
 
index 7e1be4f..10e7ef5 100644 (file)
@@ -11,8 +11,6 @@ local ltjl = luatexja.lineskip
 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
index 451c7d0..3ea84b6 100644 (file)
@@ -150,7 +150,7 @@ cjh_A = function (p, sty)
             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]
index 5232349..11f68c6 100644 (file)
@@ -21,9 +21,11 @@ local getid = node.direct.getid
 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
@@ -120,7 +122,7 @@ end
 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
@@ -167,8 +169,7 @@ local function extract(head)
             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)
index 23ca192..508de5b 100644 (file)
@@ -31,10 +31,10 @@ local node_free = node.direct.flush_node or node.direct.free
 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']
@@ -85,11 +85,11 @@ do
    }
    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
@@ -126,9 +126,9 @@ do
             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
 
@@ -143,14 +143,17 @@ local ltjf_font_metric_table  = ltjf.font_metric_table
 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
index 7145ec1..36fb7f7 100644 (file)
@@ -1,7 +1,7 @@
 --
 -- 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 = {}
@@ -224,7 +224,7 @@ local cidf_vert_processor
 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
index a07f63a..f09376c 100644 (file)
@@ -24,6 +24,7 @@ local getwidth =  node.direct.getwidth
 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
@@ -34,6 +35,7 @@ local setheight = node.direct.setheight
 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
@@ -263,9 +265,8 @@ local function texiface_low(rst, rtlr, rtlp)
    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
@@ -434,8 +435,8 @@ local function pre_low_cal_box(w, cmp)
    -- 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)
@@ -538,8 +539,8 @@ local function pre_high(ahead)
    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
@@ -594,7 +595,7 @@ do
       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)
@@ -656,7 +657,7 @@ local function post_high_break(head)
             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
@@ -688,7 +689,7 @@ local function post_high_hbox(ahead)
          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)
@@ -712,8 +713,8 @@ do
       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
@@ -779,8 +780,8 @@ do
             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
@@ -799,11 +800,11 @@ do
                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
@@ -817,7 +818,7 @@ do
                               "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
index b498551..cb14e9e 100644 (file)
 \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@
 
index 4c504dc..8134976 100644 (file)
@@ -135,7 +135,7 @@ if tex.outputmode==0 then
       '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
@@ -267,7 +267,7 @@ do
       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
 
@@ -322,7 +322,7 @@ do
       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
 
@@ -346,10 +346,10 @@ do
       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
@@ -381,7 +381,7 @@ 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'
@@ -421,16 +421,16 @@ local node_type = node.type
 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