1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16\unprotect
17
18\newif\ifproductionrun
19
20\permanent\let\ctxdirectlua \directlua
21\permanent\def\ctxsprint #1{\directlua{tex.sprint(tex.ctxcatcodes,#1)}}
22\permanent\def\ctxwrite #1{\directlua{tex.write(#1)}}
23\permanent\def\ctxcommand #1{\directlua{commands.#1}}
24\permanent\def\ctxdirectcommand#1{\directlua{commands.#1}}
25\permanent\def\ctxreport #1{\directlua{logs.writer[[#1]]}}
26
27
28
29\aliased\let\ctxlua \ctxdirectlua
30\aliased\let\luacode \ctxdirectlua
31\aliased\let\directluacode\ctxdirectlua
32
33
34
35\permanent\def\luaversion{\ctxwrite{LUAVERSION}}
36
37\permanent\def\registerctxluafile#1#2{\ctxlua{lua.registercode("#1","#2")}}
38\permanent\def\ctxloadluafile #1{\ctxlua{lua.registercode("#1")}}
39
40\registerctxluafile{luatcod.lmt}{autosuffix}
41
42\toksapp \everydump {
43 \permanent\let\ctxlatelua \latelua
44 \permanent\def\ctxlatecommand#1{\latelua{commands.#1}}
45 \aliased\let\lateluacode \ctxlatelua
46}
47
48\protect \endinput
49 |