diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-10-24 11:13:27 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-10-24 11:13:27 +0200 |
commit | d91c37679b13162a4ead85abbe564090b2e1b51c (patch) | |
tree | 01b9c9e5a2437c7381b0f6d109cd51f0f6bed84e /tex/context/base/mkiv/cldf-ini.lua | |
parent | cb218b728af372a1ed6c9188765022dc057799ac (diff) | |
download | context-d91c37679b13162a4ead85abbe564090b2e1b51c.tar.gz |
2017-10-24 10:36:00
Diffstat (limited to 'tex/context/base/mkiv/cldf-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/cldf-ini.lua | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/cldf-ini.lua b/tex/context/base/mkiv/cldf-ini.lua index 391160ebe..a2814877d 100644 --- a/tex/context/base/mkiv/cldf-ini.lua +++ b/tex/context/base/mkiv/cldf-ini.lua @@ -603,6 +603,32 @@ function context.printlines(str,raw) -- todo: see if via file is useable end end +-- function context.printtable(t,separator) -- todo: see if via file is useable +-- if separator == nil or separator == true then +-- separator = "\r" +-- elseif separator == "" then +-- separator = false +-- end +-- for i=1,#t do +-- context(t[i]) -- we need to go through catcode handling +-- if separator then +-- context(separator) +-- end +-- end +-- end + +function context.printtable(t,separator) -- todo: see if via file is useable + if separator == nil or separator == true then + separator = "\r" + elseif separator == "" or separator == false then + separator = "" + end + local s = concat(t,separator) + if s ~= "" then + context(s) + end +end + -- -- -- "{" .. ti .. "}" is somewhat slower in a cld-mkiv run than "{",ti,"}" local containseol = patterns.containseol @@ -905,22 +931,22 @@ local defaultcaller = caller setmetatableindex(context,indexer) setmetatablecall (context,caller) -function context.sprint(...) -- takes catcodes as first argument +function context.sprint(...) -- takes catcodes as first argument flush(...) end -function context.fprint(fmt,first,...) - if type(catcodes) == "number" then - if first then - flush(currentcatcodes,formatters[fmt](first,...)) +function context.fprint(first,second,third,...) + if type(first) == "number" then + if third then + flush(first,formatters[second](third,...)) else - flush(currentcatcodes,fmt) + flush(first,second) end else - if fmt then - flush(formatters[catcodes](fmt,first,...)) + if second then + flush(formatters[first](second,third,...)) else - flush(catcodes) + flush(first) end end end |