- for _, k in ipairs(flex.TAGINFO_MAIN.keys) do
- local desc = get_key_description(k, 'POI/feature in the search database')
- if flex.TAGINFO_MAIN.delete_tags[k] ~= nil then
- desc.description = string.format('%s (except for values: %s).', desc.description,
- table.concat(flex.TAGINFO_MAIN.delete_tags[k], ', '))
+ for k, values in pairs(taginfo.main) do
+ if values[1] == nil or values[1] == 'delete' or values[1] == 'extra' then
+ for v, group in pairs(values) do
+ if type(v) == 'string' and group ~= 'delete' and group ~= 'extra' then
+ local text = 'POI/feature in the search database'
+ if type(group) ~= 'function' then
+ text = 'Fallback ' .. text
+ end
+ table.insert(tags, get_key_value_description(k, v, text))
+ end
+ end
+ elseif type(values[1]) == 'function' or values[1] == 'fallback' then
+ local desc = 'POI/feature in the search database'
+ if values[1] == 'fallback' then
+ desc = 'Fallback ' .. desc
+ end
+ local excp = {}
+ for v, group in pairs(values) do
+ if group == 'delete' or group == 'extra' then
+ table.insert(excp, v)
+ end
+ end
+ if next(excp) ~= nil then
+ desc = desc .. string.format(' (except for values: %s)',
+ table.concat(excp, ', '))
+ end
+ table.insert(tags, get_key_description(k, desc))