summaryrefslogtreecommitdiff
path: root/tex/context/base/publ-dat.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-04 11:15:04 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2014-11-04 11:15:04 +0100
commit8d590f58ca0d10d33517e0f42283b128c5a450d4 (patch)
tree8feb502c4538dbef6409867d4c2d4bb09ece5bf3 /tex/context/base/publ-dat.lua
parenteeb6935cd762417068287ca41920469a329dfe2a (diff)
downloadcontext-8d590f58ca0d10d33517e0f42283b128c5a450d4.tar.gz
2014-11-04 11:04:00
Diffstat (limited to 'tex/context/base/publ-dat.lua')
-rw-r--r--tex/context/base/publ-dat.lua37
1 files changed, 23 insertions, 14 deletions
diff --git a/tex/context/base/publ-dat.lua b/tex/context/base/publ-dat.lua
index dbd48f7f8..e5a956553 100644
--- a/tex/context/base/publ-dat.lua
+++ b/tex/context/base/publ-dat.lua
@@ -124,25 +124,29 @@ local extrafields = {
crossref = "implicit",
}
+local unknowncategory = function(t,k)
+ local v = {
+ required = { },
+ optional = { },
+ }
+ t[k] = v
+ return v
+end
+
+local unknownfield = function(t,k)
+ local v = setmetatableindex(function(t,k) local v = "optional" t[k] = v return v end)
+ t[k] = v
+ return v
+end
+
local default = {
name = name,
version = "1.00",
comment = "unknown specification.",
author = "anonymous",
copyright = "no one",
- categories = setmetatableindex(function(t,k)
- local v = {
- required = { },
- optional = { },
- }
- t[k] = v
- return v
- end),
- fields = setmetatableindex(function(t,k)
- local v = setmetatableindex(function(t,k) local v = "optional" t[k] = v return v end)
- t[k] = v
- return v
- end),
+ categories = setmetatableindex(unknowncategory),
+ fields = setmetatableindex(unknownfield),
}
local types = { "optional", "required", "virtual" }
@@ -164,13 +168,18 @@ local specifications = setmetatableindex(function(t,name)
end
-- goodie for alan ...
local categories = specification.categories
+ if not categories then
+ categories = { }
+ specification.categories = categories
+ end
for k, v in next, categories do
if type(v) == "string" then
categories[k] = categories[v]
end
end
+ setmetatableindex(categories,unknowncategory)
--
- local fields = { }
+ local fields = setmetatableindex(unknownfield)
specification.fields = fields
for category, data in next, categories do
local list = setmetatableindex({},extrafields)