|
|
@ -34,16 +34,18 @@ data class GlRegistry(val enums: ImmutableSetMultimap<Long, GlEnum>, val command |
|
|
|
val enumsBuilder = ImmutableSetMultimap.builder<Long, GlEnum>() |
|
|
|
val enumsBuilder = ImmutableSetMultimap.builder<Long, GlEnum>() |
|
|
|
val groupsBuilder = HashMultimap.create<String, GlEnum>() |
|
|
|
val groupsBuilder = HashMultimap.create<String, GlEnum>() |
|
|
|
|
|
|
|
|
|
|
|
for (elements in root.getChildren("enums")) { |
|
|
|
for (parent in root.getChildren("enums")) { |
|
|
|
for (element in elements.getChildren("enum")) { |
|
|
|
val parentGroups = (parent.getAttributeValue("group") ?: "").split(",") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (element in parent.getChildren("enum")) { |
|
|
|
val name = element.getAttributeValue("name") |
|
|
|
val name = element.getAttributeValue("name") |
|
|
|
val value = parseValue(element.getAttributeValue("value")) |
|
|
|
val value = parseValue(element.getAttributeValue("value")) |
|
|
|
|
|
|
|
|
|
|
|
val enum = GlEnum(name, value) |
|
|
|
val enum = GlEnum(name, value) |
|
|
|
enumsBuilder.put(value, enum) |
|
|
|
enumsBuilder.put(value, enum) |
|
|
|
|
|
|
|
|
|
|
|
val groups = element.getAttributeValue("group") ?: continue |
|
|
|
val groups = (element.getAttributeValue("group") ?: "").split(",") |
|
|
|
for (group in groups.split(",")) { |
|
|
|
for (group in parentGroups union groups) { |
|
|
|
groupsBuilder.put(group, enum) |
|
|
|
groupsBuilder.put(group, enum) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|