1if not modules then modules = { } end modules ['luat-lua'] = {
2 version = 1.001,
3 comment = "companion to luat-lib.mkiv",
4 author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5 copyright = "PRAGMA ADE / ConTeXt Development Team",
6 license = "see context related readme files"
7}
8
9if lua then do
10
11 local delayed = { }
12
13 function lua.flushdelayed(...)
14 local t = delayed
15 delayed = { }
16 for i=1, #t do
17 t[i](...)
18 end
19 end
20
21 function lua.delay(f)
22 delayed[#delayed+1] = f
23 end
24
25 function lua.flush(...)
26 context.directlua("lua.flushdelayed(%,t)",{...})
27 end
28
29end end
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46 |