luat-cod.mkxl /size: 1588 b    last modification: 2023-12-21 09:44
1%D \module
2%D   [       file=luat-cod,
3%D        version=2005.05.26,
4%D          title=\CONTEXT\ Lua Macros,
5%D       subtitle=Code,
6%D         author=Hans Hagen,
7%D           date=\currentdate,
8%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
9%C
10%C This module is part of the \CONTEXT\ macro||package and is
11%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12%C details.
13
14% \writestatus{loading}{ConTeXt Lua Macros / Code}
15
16\unprotect
17
18\newif\ifproductionrun
19
20\permanent\let\ctxdirectlua       \directlua
21\permanent\def\ctxsprint       #1{\directlua{tex.sprint(tex.ctxcatcodes,#1)}} % saves tokens
22\permanent\def\ctxwrite        #1{\directlua{tex.write(#1)}} % saves tokens
23\permanent\def\ctxcommand      #1{\directlua{commands.#1}} % saves tokens
24\permanent\def\ctxdirectcommand#1{\directlua{commands.#1}} % saves tokens
25\permanent\def\ctxreport       #1{\directlua{logs.writer[[#1]]}}
26
27%D Take your choice \unknown
28
29\aliased\let\ctxlua       \ctxdirectlua
30\aliased\let\luacode      \ctxdirectlua
31\aliased\let\directluacode\ctxdirectlua
32
33%D Reporting the version of \LUA\ that we use is done as follows:
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{luat-cod.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} % no \appendtoks yet
47
48\protect \endinput
49