[luatex] node list
zappathustra at free.fr
Wed Nov 28 19:44:05 CET 2012
Herbert Voss <Herbert.Voss at fu-berlin.de> a écrit:
> I am playing with nodes and callbacks to understand how it works.
> function checknode(head)
> while head do
> if head.id==37 then
> if head.char==string.byte("c") then
> if head.id==0 or head.id==1 then checknode(head.list) end
> return true
callback.register takes only two arguments.
> I tried to test "node.insert_after()" instead of using the next and prev
> fields. Is it the correct way to use
> if I want to insert the new glyph node bwtween existing nodes?
head = node.insert_after(a, b, c)
to insert c after b in the list whose head is a (actually any node in
> And am i right, that the prev field from node n is missing, but
> doesn't hurt in this case? I know, that I can set it.
Actually it IS set (try "print(n.prev)"), and I'm surprised myself,
because I thought ``natural'' nodelists (created by TeX) didn't set the
prev field of their nodes, but actually they're all set. (I thought that
because node.slide() is said to set those prev fields, so I concluded
that by default they aren't.)
But anyway it wouldn't hurt, at least on the TeX side (I don't know any
internal mechanism that needs prev to be set, but I might very well be
More information about the luatex