ソースコードの管理場所
Revision | 1e11b179a00a2d77a0dca474f02965cdc9066b6f (tree) |
---|---|
Time | 2011-12-05 08:43:12 |
Author | Kazuki Maeda <kmaeda@user...> |
Commiter | Kazuki Maeda |
Add tools to dump luatexja.fmt (work in progress).
@@ -0,0 +1,6 @@ | ||
1 | +*.log | |
2 | +*.aux | |
3 | +*.toc | |
4 | +*.out | |
5 | +*.tmp | |
6 | +*~ |
@@ -0,0 +1,8 @@ | ||
1 | +# | |
2 | +# ltjfmtutil.cnf | |
3 | +# | |
4 | +# Run: fmtutil --cnffile ltjfmtutil.cnf --all | |
5 | +# | |
6 | + | |
7 | +luatexja luatex language.def,language.dat.lua luatexja.ini | |
8 | +lualatexja luatex language.def,language.dat.lua lualatexja.ini |
@@ -0,0 +1,46 @@ | ||
1 | +-- | |
2 | +-- luadump.lua | |
3 | +-- | |
4 | + | |
5 | +-- ToDo: initex 時の dofile(), loadfile() の hack | |
6 | +-- restore 時の require(), dofile(), loadfile() の hack | |
7 | +-- 読み込み済みファイルリストの作成. | |
8 | + | |
9 | +module('luadump', package.seeall) | |
10 | + | |
11 | +local require = _G.require | |
12 | + | |
13 | +function require_and_register(modname) | |
14 | + local ret = require(modname) | |
15 | + | |
16 | + local modfilename = string.gsub(modname, '[.]', '/') .. '.lua' | |
17 | + local modfilepath = kpse.find_file(modfilename) | |
18 | + if modfilepath then | |
19 | + lua.bytecode[bytecode_index] = loadfile(modfilepath) | |
20 | + bytecode_index = bytecode_index + 1 | |
21 | + end | |
22 | + | |
23 | + return ret | |
24 | +end | |
25 | + | |
26 | +function init() | |
27 | + bytecode_index = 1 | |
28 | + _G.require = require_and_register | |
29 | +end | |
30 | + | |
31 | +function finalize() | |
32 | + _G.require = require | |
33 | +end | |
34 | + | |
35 | +function restore() | |
36 | + local write_nl = texio.write_nl | |
37 | + texio.write_nl = function() end | |
38 | + local i = 1 | |
39 | + while lua.bytecode[i] do | |
40 | + print(i) | |
41 | + lua.bytecode[i]() | |
42 | + lua.bytecode[i] = nil | |
43 | + i = i + 1 | |
44 | + end | |
45 | + texio.write_nl = write_nl | |
46 | +end | |
\ No newline at end of file |
@@ -0,0 +1,37 @@ | ||
1 | +% | |
2 | +% luadump.tex | |
3 | +% | |
4 | + | |
5 | +\catcode`@=11 | |
6 | + | |
7 | +\directlua{require('luadump')} | |
8 | + | |
9 | +\let\luadump@directlua@orig\directlua | |
10 | + | |
11 | +\long\def\luadump@directlua#1{% | |
12 | + \luadump@directlua@orig{ | |
13 | + #1 | |
14 | + lua.bytecode[luadump.bytecode_index] = function() | |
15 | + #1 | |
16 | + end | |
17 | + luadump.bytecode_index = luadump.bytecode_index + 1 | |
18 | + }% | |
19 | +} | |
20 | + | |
21 | +\def\luadump@init{% | |
22 | + \directlua{luadump.init()} | |
23 | + \let\directlua\luadump@directlua | |
24 | +} | |
25 | + | |
26 | +\def\luadump@finalize{% | |
27 | + \let\directlua\luadump@directlua@orig | |
28 | + \let\luadump@directlua\undefined | |
29 | + \let\luadump@directlua@orig\undefined | |
30 | + \let\luadump@init\undefined | |
31 | + \let\luadump@finalize\undefined | |
32 | + \directlua{luadump.finalize()} | |
33 | + \everyjob{\directlua{require('luadump'); luadump.restore()}} | |
34 | + \catcode`@=12 | |
35 | +} | |
36 | + | |
37 | +\endinput |
@@ -0,0 +1,22 @@ | ||
1 | +% | |
2 | +% luatexja.ini | |
3 | +% | |
4 | + | |
5 | +\let\DUMP\dump | |
6 | +\let\dump\relax | |
7 | + | |
8 | +% from luatex.ini | |
9 | +\input luatexiniconfig.tex | |
10 | +\input luatex-unicode-letters.tex | |
11 | +\input pdftexconfig.tex | |
12 | +\input etex.ini | |
13 | + | |
14 | +\input luadump.tex | |
15 | +\luadump@init | |
16 | +\input luatexja.sty | |
17 | +\luadump@finalize | |
18 | + | |
19 | +\let\dump\DUMP | |
20 | +\let\DUMP\undefined | |
21 | + | |
22 | +\dump |