LuaTeX 0.74.0, LuaJITTeX への対応
応急処置としてはそれぐらいでよいみたいですが,LuaTeX-ja 自体の Lua 5.2 への対応が今後は必要でしょうか. table.maxn(), string.explode(), package.searcher と,module() 絡みの対応だけでよいのかな.
LuaJITTeX (0.75.0, r24) で以下のソース:
\input luatexja.sty
\directlua{require("profiler"); profiler:start("log")}
\end
を走らせてみると,
! LuaTeX error ...012/../texmf-local/tex/generic/luatexja/ltj-inputbuf.lua:24:
bad argument #3 to 'byte' (number expected, got userdata).
l.3 ...require("profiler"); profiler:start("log")}
? x
というエラーが出ます.通常の LuaTeX 0.75.0 (r4591) ではこのエラーは生じません.
LuaJITTeX 内の luaprofiler が変なのかなあ.
%#!luajittex
\directlua{
require("profiler")
profiler:start('log')
print()
}
\end
を実行すると,
This is LuajitTeX, Version beta-0.75.0-2013031106 (rev 24) restricted \write18 enabled. (./b.texuserdata: 0x02da0e30 ) No pages of output. Transcript written on b.log.と不要な出力 userdata: ... があります. profiler:start("log") を削除するとこの症状は出ません.
LuaTeX-ja 自体の Lua 5.2 への対応が今後は必要でしょうか.
遅くなりましたがコメントしますと,
ぐらいですね.
別チケット #31302 を作ったのでこっちは完了とします.
便宜上「サポートリクエスト」にしていますが,インフォメーションです.
遅ればせながら,Lua 5.2 が導入された LuaTeX (r4569) を導入してみました. LuaTeX-ja 日本語マニュアルで実験してみましたが, Lua 5.2 で削除/名称変更された関数を適宜補うだけで動作するようです.
具体的には,lualatex.ini 最後の \dump の前に,以下の内容を入れました(luatex.ini も同様):
{\catcode`\#=12\catcode`\~=12% \global\everyjob\expandafter{\the\everyjob% \directlua{% if not table.maxn then table.maxn = function(t) local r = 0 for i,_ in pairs(t) do if type(i)=='number' then if i>r then r=i end end end return r end end if not package.loaders then package.loaders=package.searchers end if not string.explode then string.explode = function (str, separator) if not separator then separator=" +" end local t, nexti, pos = { }, 1, 1 while true do local st, sp = str:find (separator, pos) if not st then break end if pos ~= st then t [ nexti ] = str:sub ( pos , st - 1 ) nexti = nexti + 1 end pos = sp + 1 end t [ nexti ] = str:sub ( pos ) return t end end }% }}%まだビット演算 (bit32) などについては試していません.