-
-
-------------------------------------------------------------------------
--- FIX node.remove
-------------------------------------------------------------------------
-do
- local node_remove, node_next, node_prev = node.remove, node.next, node.prev
- function luatexja.node_remove (head, current)
- if head==current then
- local q, r = node_next(current), node_prev(current)
- if q then q.prev = r end
- if r and node_next(r)==current then
- r.next = q
- end
- return q, q
- else
- return node_remove(head, current)
- end
- end
- local Dnode = node.direct or node
- if Dnode~=node then
- local Dnode_remove, setfield = Dnode.remove, Dnode.setfield
- local Dnode_next, Dnode_prev = Dnode.getnext, Dnode.getprev
- function luatexja.Dnode_remove (head, current)
- if head==current then
- local q, r = Dnode_next(current), Dnode_prev(current)
- if q then setfield(q, 'prev', r) end
- if r and Dnode_next(r) == current then
- setfield(r, 'next', q)
- end
- return q, q
- else
- return Dnode_remove(head, current)
- end
- end
- else
- luatexja.Dnode_remove = luatexja.node_remove
- end
-end
-