Tíquete #30652

LuaTeX 0.74.0, LuaJITTeX への対応

: 2013-01-31 19:37 Última Atualização: 2013-05-07 12:41

Relator:
Dono:
(Nenhum)
Estado:
Fechado
Componente:
(Nenhum)
Marcos:
(Nenhum)
Prioridade:
5 - Medium
Gravidade:
5 - Medium
Resolução:
Remind
Arquivo:
Nenhum

Details

便宜上「サポートリクエスト」にしていますが,インフォメーションです.

遅ればせながら,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) などについては試していません.

Ticket History (3/6 Histories)

2013-01-31 19:37 Updated by: h7k
  • New Ticket "LuaTeX 0.74.0, LuaJITTeX への対応" created
2013-01-31 22:58 Updated by: kmaeda
Comentário

応急処置としてはそれぐらいでよいみたいですが,LuaTeX-ja 自体の Lua 5.2 への対応が今後は必要でしょうか. table.maxn(), string.explode(), package.searcher と,module() 絡みの対応だけでよいのかな.

2013-03-13 07:36 Updated by: h7k
Comentário

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) ではこのエラーは生じません.

2013-03-13 16:37 Updated by: h7k
Comentário

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") を削除するとこの症状は出ません.

2013-03-25 08:44 Updated by: h7k
Comentário

LuaTeX-ja 自体の Lua 5.2 への対応が今後は必要でしょうか.

遅くなりましたがコメントしますと,

  • module() はなんとかしないといけない^^;
  • string.explode() は ltj-base.lua で使用中.local に上の定義を追加すればよいか.
  • ltj-infomute.lua は現在は使用不能(setfenv, getfenv 廃止)だが,このファイルはどこからも読み込まれてない

ぐらいですね.

2013-05-07 12:41 Updated by: h7k
  • Resolução Update from Nenhum to Remind
  • Estado Update from Aberto to Fechado
  • Ticket Close date is changed to 2013-05-07 12:41
Comentário

別チケット #31302 を作ったのでこっちは完了とします.

Attachment File List

No attachments

Editar

You are not logged in. I you are not logged in, your comment will be treated as an anonymous post. » Login