From 65d009a0596b194597f47531523addd3e64ed005 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 20 Mar 2018 22:10:59 +0000 Subject: context [current] (20mar18) git-svn-id: svn://tug.org/texlive/trunk@47050 c570f23f-e606-0410-a88d-b1316a301751 --- .../texmf-dist/tex/context/base/mkiv/cldf-ini.lua | 46 +++++++++++++++++----- 1 file changed, 36 insertions(+), 10 deletions(-) (limited to 'Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua') diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua index 3c91f5fba1a..a2814877de8 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua @@ -319,7 +319,7 @@ local interfacescanners = setmetatablenewindex(function(t,k,v) rawset(t,k,v) end) -interfaces.scanners = interfacescanners +interfaces.scanners = storage.mark(interfacescanners) context.functions = { register = registerfunction, @@ -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 -- cgit v1.2.3