\luaexec{%
local upper = unicode.utf8.upper
local char = unicode.utf8.char
mytokens = function()
local t = token.get_next()
if t[3] == 0 and t[1] == 11 then
print(upper(char(t[2])), t[1], t[3])
end
return t
end
}
\newcommand\ojoj[1]{%
\luaexec{luatexbase.add_to_callback("token_filter", mytokens, "hello")}%
#1%
\luaexec{luatexbase.remove_from_callback("token_filter", "hello")}%
}
ahoj ahoj \ojoj{nazdar} ahoj