diff options
author | Hans Hagen <pragma@wxs.nl> | 2010-08-19 01:08:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2010-08-19 01:08:00 +0200 |
commit | 174663b0081dd76f91c45fd705262a262a7b1f49 (patch) | |
tree | 554d5d47e81a9263e98fe7091be7e4dbd363482b /tex/context/base/mult-cld.lua | |
parent | e68c228a21a98042c87ef21d9a094b97f941e8de (diff) | |
download | context-174663b0081dd76f91c45fd705262a262a7b1f49.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) .. "}}") |