%{
--------------------------------------------------------------------------------
--
--  This file is part of the Doxyrest toolkit.
--
--  Doxyrest is distributed under the MIT license.
--  For details see accompanying license.txt file,
--  the public copy of which is also available at:
--  http://tibbo.com/downloads/archive/doxyrest/license.txt
--
--------------------------------------------------------------------------------

local argArray = table.pack(...)
local itemArray = argArray[1]

local function addEnumValues(enum, rootEnum)
	if LANGUAGE == "jancy" and not enum.baseType.isEmpty then
		baseEnum = findLinkedTextEnum(enum.baseType)
		if baseEnum ~= nil then
			if not rootEnum then
				rootEnum = enum
			end
			addEnumValues(baseEnum, rootEnum)
		end
	end

	for i = 1, #enum.enumValueArray do
		local enumValue = enum.enumValueArray[i]
		local enumValueName

		if rootEnum then
			enumValueName = getItemQualifiedName(rootEnum) .. g_nameDelimiter .. enumValue.name
		else
			enumValueName = getItemQualifiedName(enumValue)

			-- remove parent enum name (C++ only)
			enumValueName = string.gsub(enumValueName, "([%w_]+)::([%w_]+)$", "%2")
		end
}
	'$enumValueName' : 'doxid-$(enumValue.id)',
%{
	end -- for
end

for i = 1, #itemArray do
	local item = itemArray[i]
	if not isUnnamedItem(item) then
}
	'$(getItemQualifiedName(item))' : 'doxid-$(item.id)',
%{
	end -- if

	addEnumValues(item)
end -- for
}
