mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-22 03:10:56 +00:00
Don't fail on untyped enumerations
This commit is contained in:
@@ -60,12 +60,14 @@ namespace {
|
|||||||
} else if (t.type == IfcParse::Token_BOOL) {
|
} else if (t.type == IfcParse::Token_BOOL) {
|
||||||
fn(IfcParse::TokenFunc::asBool(t));
|
fn(IfcParse::TokenFunc::asBool(t));
|
||||||
} else if (t.type == IfcParse::Token_ENUMERATION) {
|
} else if (t.type == IfcParse::Token_ENUMERATION) {
|
||||||
if (decl->as_enumeration_type()) {
|
if (decl && decl->as_enumeration_type()) {
|
||||||
try {
|
try {
|
||||||
fn(EnumerationReference(decl->as_enumeration_type(), decl->as_enumeration_type()->lookup_enum_offset(IfcParse::TokenFunc::asStringRef(t))));
|
fn(EnumerationReference(decl->as_enumeration_type(), decl->as_enumeration_type()->lookup_enum_offset(IfcParse::TokenFunc::asStringRef(t))));
|
||||||
} catch (IfcParse::IfcException& e) {
|
} catch (IfcParse::IfcException& e) {
|
||||||
Logger::Error(e);
|
Logger::Error(e);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Logger::Error("Untyped enumeration encountered");
|
||||||
}
|
}
|
||||||
} else if (t.type == IfcParse::Token_FLOAT) {
|
} else if (t.type == IfcParse::Token_FLOAT) {
|
||||||
fn(IfcParse::TokenFunc::asFloat(t));
|
fn(IfcParse::TokenFunc::asFloat(t));
|
||||||
|
|||||||
Reference in New Issue
Block a user