diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/core-two.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/core-two.lua | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/Master/texmf-dist/tex/context/base/core-two.lua b/Master/texmf-dist/tex/context/base/core-two.lua index 1f2bc7c6cf8..bb1afa7db2f 100644 --- a/Master/texmf-dist/tex/context/base/core-two.lua +++ b/Master/texmf-dist/tex/context/base/core-two.lua @@ -42,9 +42,13 @@ end jobpasses.define = allocate -function jobpasses.save(id,str) +function jobpasses.save(id,str,index) local jti = allocate(id) - jti[#jti+1] = str + if index then + jti[index] = str + else + jti[#jti+1] = str + end end function jobpasses.savetagged(id,tag,str) @@ -140,18 +144,36 @@ jobpasses.inlist = inlist -- interface -function commands.gettwopassdata (id) local r = get (id) if r then context(r) end end -function commands.getfirsttwopassdata(id) local r = first(id) if r then context(r) end end -function commands.getlasttwopassdata (id) local r = last (id) if r then context(r) end end -function commands.findtwopassdata (id,n) local r = find (id,n) if r then context(r) end end -function commands.gettwopassdatalist (id) local r = list (id) if r then context(r) end end -function commands.counttwopassdata (id) local r = count(id) if r then context(r) end end -function commands.checktwopassdata (id) local r = check(id) if r then context(r) end end +local implement = interfaces.implement -commands.definetwopasslist = jobpasses.define -commands.savetwopassdata = jobpasses.save -commands.savetaggedtwopassdata = jobpasses.savetagged +implement { name = "gettwopassdata", actions = { get , context }, arguments = "string" } +implement { name = "getfirsttwopassdata",actions = { first, context }, arguments = "string" } +implement { name = "getlasttwopassdata", actions = { last , context }, arguments = "string" } +implement { name = "findtwopassdata", actions = { find , context }, arguments = { "string", "string" } } +implement { name = "gettwopassdatalist", actions = { list , context }, arguments = "string" } +implement { name = "counttwopassdata", actions = { count, context }, arguments = "string" } +implement { name = "checktwopassdata", actions = { check, context }, arguments = "string" } -function commands.doifelseintwopassdata(id,str) - commands.doifelse(inlist(id,str)) -end +implement { + name = "definetwopasslist", + actions = jobpasses.define, + arguments = "string" +} + +implement { + name = "savetwopassdata", + actions = jobpasses.save, + arguments = { "string", "string" } +} + +implement { + name = "savetaggedtwopassdata", + actions = jobpasses.savetagged, + arguments = { "string", "string", "string" } +} + +implement { + name = "doifelseintwopassdata", + actions = { inlist, commands.doifelse }, + arguments = { "string", "string" } +} |