Hello,
take this plain LuaTeX example:
\setbox0=\hbox{\pdfextension literal{0 g}}
% 1)
\directlua{
local literal = tex.getbox(0).head
texio.write_nl("log", "literal.data="..literal.data)
}
\showbox0
% 2)
\directlua{
local literal = tex.getbox(0).head
literal.data = "test"
literal.token = "toks"
texio.write_nl("log", "literal.token="..(literal.token or "nil"))
}
\showbox0
% 3) patch test
\directlua{
tex.set("everyjob", "asd")
texio.write_nl("log", tex.get("everyjob"))
}
\bye
Expected log output (abridged):
1)
literal.data=0 g
.\pdfliteral origin{0 g}
2)
literal.token=toks
.\pdfliteral origin{toks}
Actual output:
1)
literal.data=data
.\pdfliteral origin{0 g}
2)
literal.token=characters
.\pdfliteral origin