diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-06-13 09:56:22 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-06-13 09:56:22 +0200 |
commit | 204057fdc5023b5f4ff55a69bc6593388ea427e7 (patch) | |
tree | 2153d525f1fb854189772d3109be782a0aeb14fd /tex/context/base/mkiv/cldf-ini.lua | |
parent | 7686a24f79edfef2a9d013882c822c76a12e23dc (diff) | |
download | context-204057fdc5023b5f4ff55a69bc6593388ea427e7.tar.gz |
2018-06-12 21:56:00
Diffstat (limited to 'tex/context/base/mkiv/cldf-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/cldf-ini.lua | 82 |
1 files changed, 42 insertions, 40 deletions
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua index 54048b52a..dabdbb9b0 100644 --- a/tex/context/base/mkiv/cldf-ini.lua +++ b/tex/context/base/mkiv/cldf-ini.lua @@ -1454,7 +1454,7 @@ do local function indexer(parent,k) local f = function(...) - local a = { ... } + local a = { ... } -- this also freezes ... return function() -- return context[k](unpack(a)) return core[k](unpack(a)) @@ -1479,46 +1479,48 @@ do end -do - - -- context.nested (todo: lines), creates strings - - local nested = { } - - local function indexer(parent,k) -- not ok when traced - local f = function(...) - local t, savedflush, n = { }, flush, 0 - flush = function(c,f,s,...) -- catcodes are ignored - n = n + 1 - t[n] = s and concat{f,s,...} or f -- optimized for #args == 1 - end - -- context[k](...) - core[k](...) - flush = savedflush - return concat(t) - end - parent[k] = f - return f - end - - local function caller(parent,...) - local t, savedflush, n = { }, flush, 0 - flush = function(c,f,s,...) -- catcodes are ignored - n = n + 1 - t[n] = s and concat{f,s,...} or f -- optimized for #args == 1 - end - -- context(...) - defaultcaller(context,...) - flush = savedflush - return concat(t) - end - - setmetatableindex(nested,indexer) - setmetatablecall (nested,caller) - - context.nested = nested +-- do +-- +-- -- context.nested (todo: lines), creates strings +-- +-- local nested = { } +-- +-- local function indexer(parent,k) -- not ok when traced +-- local f = function(...) +-- local t, savedflush, n = { }, flush, 0 +-- flush = function(c,f,s,...) -- catcodes are ignored +-- n = n + 1 +-- t[n] = s and concat{f,s,...} or f -- optimized for #args == 1 +-- end +-- -- context[k](...) +-- core[k](...) +-- flush = savedflush +-- return concat(t) +-- end +-- parent[k] = f +-- return f +-- end +-- +-- local function caller(parent,...) +-- local t, savedflush, n = { }, flush, 0 +-- flush = function(c,f,s,...) -- catcodes are ignored +-- n = n + 1 +-- t[n] = s and concat{f,s,...} or f -- optimized for #args == 1 +-- end +-- -- context(...) +-- defaultcaller(context,...) +-- flush = savedflush +-- return concat(t) +-- end +-- +-- setmetatableindex(nested,indexer) +-- setmetatablecall (nested,caller) +-- +-- context.nested = nested +-- +-- end -end +context.nested = context.delayed -- verbatim |