diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-20 22:10:59 +0000 |
commit | 65d009a0596b194597f47531523addd3e64ed005 (patch) | |
tree | e13bd9beecf63e26491a66aa7a8fa702482f0067 /Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua | |
parent | d1a186333ced7b341e26877907343f08211199f7 (diff) |
context [current] (20mar18)
git-svn-id: svn://tug.org/texlive/trunk@47050 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/cldf-ini.lua | 46 |
1 files changed, 36 insertions, 10 deletions
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 |