mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
Set remapped type for previously undefined types for StructuredDataDef
This commit is contained in:
parent
dc075847ff
commit
2fa1144425
@ -47,7 +47,12 @@ namespace sdd::def_scope_sequences
|
|||||||
if (existingType != state->m_def_types_by_name.end())
|
if (existingType != state->m_def_types_by_name.end())
|
||||||
{
|
{
|
||||||
if (existingType->second.m_category == CommonStructuredDataTypeCategory::UNKNOWN)
|
if (existingType->second.m_category == CommonStructuredDataTypeCategory::UNKNOWN)
|
||||||
existingType->second = CommonStructuredDataType(CommonStructuredDataTypeCategory::ENUM, newEnumIndex);
|
{
|
||||||
|
assert(existingType->second.m_info.type_index < state->m_undefined_types.size());
|
||||||
|
auto& undefinedType = state->m_undefined_types[existingType->second.m_info.type_index];
|
||||||
|
undefinedType.m_mapped_type = CommonStructuredDataType(CommonStructuredDataTypeCategory::ENUM, newEnumIndex);
|
||||||
|
existingType->second = undefinedType.m_mapped_type;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw ParsingException(nameToken.GetPos(), "Type with this name has already been defined");
|
throw ParsingException(nameToken.GetPos(), "Type with this name has already been defined");
|
||||||
}
|
}
|
||||||
@ -89,7 +94,12 @@ namespace sdd::def_scope_sequences
|
|||||||
if (existingType != state->m_def_types_by_name.end())
|
if (existingType != state->m_def_types_by_name.end())
|
||||||
{
|
{
|
||||||
if (existingType->second.m_category == CommonStructuredDataTypeCategory::UNKNOWN)
|
if (existingType->second.m_category == CommonStructuredDataTypeCategory::UNKNOWN)
|
||||||
existingType->second = CommonStructuredDataType(CommonStructuredDataTypeCategory::STRUCT, newStructIndex);
|
{
|
||||||
|
assert(existingType->second.m_info.type_index < state->m_undefined_types.size());
|
||||||
|
auto& undefinedType = state->m_undefined_types[existingType->second.m_info.type_index];
|
||||||
|
undefinedType.m_mapped_type = CommonStructuredDataType(CommonStructuredDataTypeCategory::STRUCT, newStructIndex);
|
||||||
|
existingType->second = undefinedType.m_mapped_type;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
throw ParsingException(nameToken.GetPos(), "Type with this name has already been defined");
|
throw ParsingException(nameToken.GetPos(), "Type with this name has already been defined");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user