[luatex] Glue node without spec field?

luigi scarso luigi.scarso at gmail.com
Thu Jan 7 13:00:25 CET 2010


On Thu, Jan 7, 2010 at 9:11 AM, Taco Hoekwater <taco at elvenkind.com> wrote:
>
>
> Manuel Pégourié-Gonnard wrote:
>> Hi,
>>
>>>From the LuaTeX manual, I'm inclined to think that a glue node always have a
>> spec field. However, experience shows that it's not true:
>>
>> \directlua{%
>> assert(callback.register('post_linebreak_filter', function(head)
>>     local n = node.slide(head.list)
>>     assert(node.type(n.id) == 'glue', 'last node is not glue.')
>>     assert(n.spec, 'glue node without spec field')
>> end))}
>> Blah.
>> \bye
>>
>> compile with luatex 0.50.0 gives an error:
>>
>> error: <\directlua >:1: glue node (subtype 9) without spec field
>>
>> Am I misunderstanding the manual, or is this a bug?
>
> That was a bug, fixed in svn trunk now. If you don't want to compile
> the trunk, you can just treat 'nil' in a spec field as equal to 0.
If I understand it correctly,
if subtype is not 0 then spec is an empty node

So in this case
print(n.subtype,n.spec)
gives
subtype=9  and spec= <node    nil <      0 >    nil : glue_spec 0>)

This is different to say that
if subtype is not 0 then spec is nil

But now
print(n.subtype,n.spec,n.leader)
gives
9 <node    nil <      0 >    nil : glue_spec 0>   nil

ie
n.leader == nil

Is it OK ?

-- 
luigi



More information about the luatex mailing list