Hello, I created a small patch to add several internal parameters to the "tex" table, among them \currentgrouplevel (the patch is based on the current SVN trunk): % diff --normal luatex.web.orig luatex.web 9829a9830,9831
@!negative:boolean; { always false} @!q:halfword; { general purpose index} 9830a9833 negative:=false; 9844a9848 last_item: @
;
I adapted this from procedure "scan_something_internal" and added local variables until it compiled (ahem). "q" seems unproblematic, "negative" is a parameter in "scan_something_internal", most likely to handle expressions like "-\currentgrouplevel". As this is not used when accessing the parameters from Lua, I set it to "false". I only tested it with \currentgrouplevel, \eTeXversion, \pdflastobj, \pdftexversion and \inputlineno; it seems to work. Example: %&luatex \begingroup \begingroup \directlua0{texio.write_nl(tex.currentgrouplevel)} \directlua0{texio.write_nl(tex.eTeXversion)} \directlua0{texio.write_nl(tex.pdflastobj)} \directlua0{texio.write_nl(tex.pdftexversion)} \directlua0{texio.write_nl(tex.inputlineno)} \endgroup \endgroup \bye This is LuaTeX, Version snapshot-0.29.0-2008082107 (Web2C 7.5.7) (currentgrouplevel.tex 2 2 0 200 9 ) No pages of output. Transcript written on currentgrouplevel.log. Jonathan