diff options
author | Karl Berry <karl@freefriends.org> | 2013-04-08 00:43:40 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2013-04-08 00:43:40 +0000 |
commit | 824f7b0903de8ad7f6ee3d7656005e4c59155e06 (patch) | |
tree | abfc8673ef9916f3ab7074e811207384c301492b /Master/texmf-dist/tex/context/base/pack-obj.lua | |
parent | 689aefb0727676ed3cddf331337b4be226495e72 (diff) |
context import for TL13, from www.pragma-ade.com/context/beta/cont-tmf.zip
git-svn-id: svn://tug.org/texlive/trunk@29731 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/context/base/pack-obj.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/pack-obj.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/Master/texmf-dist/tex/context/base/pack-obj.lua b/Master/texmf-dist/tex/context/base/pack-obj.lua index c580aaa6287..1e4e0f59e5b 100644 --- a/Master/texmf-dist/tex/context/base/pack-obj.lua +++ b/Master/texmf-dist/tex/context/base/pack-obj.lua @@ -11,6 +11,8 @@ if not modules then modules = { } end modules ['pack-obj'] = { reusable components.</p> --ldx]]-- +local commands, context = commands, context + local texcount = tex.count local allocate = utilities.storage.allocate @@ -46,15 +48,30 @@ end function jobobjects.number(tag,default) local o = collected[tag] or tobesaved[tag] - context((o and o[1]) or default) + return o and o[1] or default end function jobobjects.page(tag,default) local o = collected[tag] or tobesaved[tag] - context((o and o[2]) or default) + return o and o[2] or default +end + +-- interface + +commands.saveobject = jobobjects.save +commands.setobject = jobobjects.set + +function commands.objectnumber(tag,default) + local o = collected[tag] or tobesaved[tag] + context(o and o[1] or default) +end + +function commands.objectpage(tag,default) + local o = collected[tag] or tobesaved[tag] + context(o and o[2] or default) end -function jobobjects.doifelse(tag) - commands.testcase(collected[tag] or tobesaved[tag]) +function commands.doifobjectreferencefoundelse(tag) + commands.doifelse(collected[tag] or tobesaved[tag]) end |