diff options
author | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2010-08-19 10:29:42 +0300 |
commit | 7d7e0d3c8d778650105cfb479f31a2bb54d69d50 (patch) | |
tree | e0c4e7d8bf466a70af56be02a0de703bbd09a5af /tex/context/base/mult-cld.lua | |
parent | b469b8ec1b494ab72cd462bfc539ce01440e6aaf (diff) | |
download | context-7d7e0d3c8d778650105cfb479f31a2bb54d69d50.tar.gz |
beta 2010.08.19 01:08
Diffstat (limited to 'tex/context/base/mult-cld.lua')
-rw-r--r-- | tex/context/base/mult-cld.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/tex/context/base/mult-cld.lua b/tex/context/base/mult-cld.lua index 9e7f94287..ac746b28b 100644 --- a/tex/context/base/mult-cld.lua +++ b/tex/context/base/mult-cld.lua @@ -20,10 +20,12 @@ context = context or { } local format, concat = string.format, table.concat local next, type, tostring = next, type, tostring -local texsprint, texiowrite, ctxcatcodes = tex.sprint, texio.write, tex.ctxcatcodes +local texsprint, texiowrite, texcount, ctxcatcodes = tex.sprint, texio.write, tex.count, tex.ctxcatcodes local flush = texsprint or function(cct,...) print(concat{...}) end +local report_cld = logs.new("cld") + local _stack_, _n_ = { }, 0 local function _store_(ti) @@ -33,7 +35,10 @@ local function _store_(ti) end local function _flush_(n) - if not _stack_[n]() then + local sn = _stack_[n] + if not sn then + report_cld("data with id %s cannot be found on stack",n) + elseif not sn() and texcount.trialtypesettingmode == 0 then _stack_[n] = nil else -- keep, beware, that way the stack can grow @@ -201,7 +206,9 @@ local function indexer(t,k) end local function caller(t,f,a,...) - if a then + if not t then + -- so we don't need to test in the calling (slower but often no issue) + elseif a then flush(ctxcatcodes,format(f,a,...)) elseif type(f) == "function" then flush(ctxcatcodes,"{\\mkivflush{" .. _store_(f) .. "}}") |