1
0
mirror of synced 2024-11-28 17:40:51 +01:00

Fixed enums failing to validate

This commit is contained in:
WerWolv 2020-11-22 02:25:03 +01:00
parent 0ce1b5d40b
commit 033ef3889a

View File

@ -37,7 +37,7 @@ namespace hex::lang {
if (typeDeclNode->getAssignedType() == Token::TypeToken::Type::CustomType && !typeNames.contains(typeDeclNode->getAssignedCustomTypeName())) if (typeDeclNode->getAssignedType() == Token::TypeToken::Type::CustomType && !typeNames.contains(typeDeclNode->getAssignedCustomTypeName()))
return false; return false;
} }
break; break;
case ASTNode::Type::Struct: case ASTNode::Type::Struct:
{ {
// Check for duplicate type name // Check for duplicate type name
@ -51,7 +51,7 @@ namespace hex::lang {
if (!memberNames.insert(static_cast<ASTNodeVariableDecl*>(member)->getVariableName()).second) if (!memberNames.insert(static_cast<ASTNodeVariableDecl*>(member)->getVariableName()).second)
return false; return false;
} }
break; break;
case ASTNode::Type::Enum: case ASTNode::Type::Enum:
{ {
// Check for duplicate type name // Check for duplicate type name
@ -65,6 +65,7 @@ namespace hex::lang {
if (!constantNames.insert(name).second) if (!constantNames.insert(name).second)
return false; return false;
} }
break;
case ASTNode::Type::Bitfield: case ASTNode::Type::Bitfield:
{ {
// Check for duplicate type name // Check for duplicate type name
@ -86,7 +87,7 @@ namespace hex::lang {
if (bitfieldSize > 64) if (bitfieldSize > 64)
return false; return false;
} }
break; break;
} }
} }