diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua | 37 |
1 files changed, 8 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua index bc6135e7242..13bdf77865b 100644 --- a/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua +++ b/Master/texmf-dist/tex/context/base/mkiv/strc-lst.lua @@ -35,8 +35,6 @@ local commands = commands local implement = interfaces.implement local conditionals = tex.conditionals -local ctx_latelua = context.latelua - local structures = structures local lists = structures.lists local sections = structures.sections @@ -99,8 +97,7 @@ local v_default = variables.default -- for the moment not public -- local function zerostrippedconcat(t,separator) - local f = 1 - local l = #t + local f, l = 1, #t for i=f,l do if t[i] == 0 then f = f + 1 @@ -310,8 +307,7 @@ local synchronizepage = function(r) -- bah ... will move return synchronizepage(r) end -local function enhancelist(specification) - local n = specification.n +function lists.enhance(n) local l = cached[n] if not l then report_lists("enhancing %a, unknown internal",n) @@ -352,8 +348,6 @@ local function enhancelist(specification) end end -lists.enhance = enhancelist - -- we can use level instead but we can also decide to remove level from the metadata local nesting = { } @@ -853,22 +847,18 @@ end function lists.userdata(name,r,tag) -- to tex (todo: xml) local result = lists.result[r] if result then - local userdata = result.userdata + local userdata, metadata = result.userdata, result.metadata local str = userdata and userdata[tag] if str then - return str, result.metadata + return str, metadata end end end function lists.uservalue(name,r,tag,default) -- to lua local str = lists.result[r] - if str then - str = str.userdata - end - if str then - str = str[tag] - end + str = str and str.userdata + str = str and str[tag] return str or default end @@ -1081,19 +1071,8 @@ implement { implement { name = "enhancelist", - arguments = "integer", - actions = function(n) - enhancelist { n = n } - end -} - -implement { - name = "deferredenhancelist", - arguments = "integer", - protected = true, -- for now, pre 1.09 - actions = function(n) - ctx_latelua { action = enhancelist, n = n } - end, + actions = lists.enhance, + arguments = "integer" } implement { |