I think it is a bug. Luatex tries to expand data field content like with \edef thats why you get \iffalse.
With older texlive (v0.76) the same example prints:

table: 03420800
table: 034212F0
table: 03421318

\documentclass{article}
\begin{document}
\directlua{
  callback.register('vpack_filter',
    function(head)
      if node.type(head.id) == 'whatsit' and head.subtype == 1 then
        print (head.data)
      end
      return true
    end,
    'debug'
  )
}
\begin{figure}
  \caption{test}
\end{figure}
\end{document}



On 5/17/2025 1:54 PM, Josef Friedrich wrote:
I’m the maintainer of the nodetree package. I got a bug report: 
https://github.com/Josef-Friedrich/nodetree/issues/46
I was able to narrow down the problem:

debug.tex:

\documentclass{article}
\begin{document}
\directlua{
   luatexbase.add_to_callback('vpack_filter',
     function(head)
       if node.type(head.id) == 'whatsit' and head.subtype == 1 then
         local tmp = head.data
       end
       return true
     end,
     'debug'
   )
}
\begin{figure}
   \caption{test}
\end{figure}
\end{document}

lualatex debug.tex:

! Incomplete \iffalse; all text was ignored after line 19.
<inserted text>
\fi
l.19 \end{figure}
The line 'local tmp = head.data' causes the error. I tried also 'print(head.data)' or 'local tmp = head['data']'. These access types also caused a crash.

Access to fields other than data works without any problems.

   print(head.stream)
   print(head.id)
   print(head.xxx)

Is this a bug in LuaTeX? Or how can I access the field 'data' of a 
whatsit(write) node for debugging purposes?

_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]

_______________________________________________
dev-luatex mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to