diff options
Diffstat (limited to 'tex/context/base/mkiv/mlib-mpf.lua')
-rw-r--r-- | tex/context/base/mkiv/mlib-mpf.lua | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/tex/context/base/mkiv/mlib-mpf.lua b/tex/context/base/mkiv/mlib-mpf.lua index 7452c0111..7e2a01ffb 100644 --- a/tex/context/base/mkiv/mlib-mpf.lua +++ b/tex/context/base/mkiv/mlib-mpf.lua @@ -247,7 +247,7 @@ do -- writers - local function mpp(value) + local function rawmpp(value) n = n + 1 local t = type(value) if t == "number" then @@ -268,13 +268,13 @@ do local function mpprint(first,second,...) if second == nil then if first ~= nil then - mpp(first) + rawmpp(first) end else for i=1,select("#",first,second,...) do local value = (select(i,first,second,...)) if value ~= nil then - mpp(value) + rawmpp(value) end end end @@ -653,6 +653,25 @@ do for k, v in next, aux do mp[k] = v end + -- mp.print = table.setmetatablecall(aux, function(t,...) + -- mpprint(...) + -- end) + + mp.print = table.setmetatablecall(aux, function(t,first,second,...) + if second == nil then + if first ~= nil then + rawmpp(first) + end + else + for i=1,select("#",first,second,...) do + local value = (select(i,first,second,...)) + if value ~= nil then + rawmpp(value) + end + end + end + end) + end do |