diff options
author | Marius <mariausol@gmail.com> | 2012-10-19 01:21:22 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2012-10-19 01:21:22 +0300 |
commit | c36e19abdfd15bf6cae6fa379c6ce51f3ef5332d (patch) | |
tree | 385d8e72bcaf31513b9ae46ec947818648187082 /tex/context/base/pack-obj.lua | |
parent | 69d2352af4b60929b37fc49f3bdb263977016244 (diff) | |
download | context-c36e19abdfd15bf6cae6fa379c6ce51f3ef5332d.tar.gz |
beta 2012.10.19 00:06
Diffstat (limited to 'tex/context/base/pack-obj.lua')
-rw-r--r-- | tex/context/base/pack-obj.lua | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/tex/context/base/pack-obj.lua b/tex/context/base/pack-obj.lua index c580aaa62..1e4e0f59e 100644 --- a/tex/context/base/pack-obj.lua +++ b/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 |