From 64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524 Mon Sep 17 00:00:00 2001 From: Hans Hagen Date: Thu, 4 Apr 2019 14:11:01 +0200 Subject: 2019-04-04 13:38:00 --- tex/context/base/mkiv/buff-ini.lua | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'tex/context/base/mkiv/buff-ini.lua') diff --git a/tex/context/base/mkiv/buff-ini.lua b/tex/context/base/mkiv/buff-ini.lua index 632565fc7..ecb5d9dd0 100644 --- a/tex/context/base/mkiv/buff-ini.lua +++ b/tex/context/base/mkiv/buff-ini.lua @@ -167,7 +167,8 @@ local function collectcontent(name,separator) -- no print elseif nnames == 1 then return getcontent(names[1]) else - local t, n = { }, 0 + local t = { } + local n = 0 for i=1,nnames do local c = getcontent(names[i]) if c ~= "" then @@ -350,11 +351,17 @@ buffers.undent = undent -- commands.doifelse(more) -- end +local split = table.setmetatableindex(function(t,k) + local v = totable(k) + t[k] = v + return v +end) + function tokens.pickup(start,stop) - local stoplist = totable(stop) + local stoplist = split[stop] -- totable(stop) local stoplength = #stoplist local stoplast = stoplist[stoplength] - local startlist = totable(start) + local startlist = split[start] -- totable(start) local startlength = #startlist local startlast = startlist[startlength] local list = { } -- cgit v1.2.3