1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 19:48:20 +02:00

Fixed constExprs with ints, hover for enum values, _ for enums

This commit is contained in:
Brian Fiete 2019-12-24 13:13:04 -08:00
parent 4087bf8e2a
commit 4dcd7f9c6a
21 changed files with 293 additions and 142 deletions

View file

@ -2198,7 +2198,7 @@ int BfResolvedTypeSet::Hash(BfType* type, LookupContext* ctx, bool allowRef)
else if (type->IsConstExprValue())
{
BfConstExprValueType* constExprValueType = (BfConstExprValueType*)type;
int hashVal = ((int)constExprValueType->mValue.mTypeCode << 17) ^ (constExprValueType->mValue.mInt32 << 3) ^ HASH_CONSTTYPE;
int hashVal = (constExprValueType->mValue.mInt32 << 17) ^ HASH_CONSTTYPE;
int elemHash = Hash(constExprValueType->mType, ctx);
hashVal = ((hashVal ^ elemHash) << 5) - hashVal;
return hashVal;
@ -2897,8 +2897,7 @@ bool BfResolvedTypeSet::Equals(BfType* lhs, BfType* rhs, LookupContext* ctx)
BfConstExprValueType* lhsConstExprValueType = (BfConstExprValueType*)lhs;
BfConstExprValueType* rhsConstExprValueType = (BfConstExprValueType*)rhs;
return (lhsConstExprValueType->mType == rhsConstExprValueType->mType) &&
(lhsConstExprValueType->mValue.mTypeCode == rhsConstExprValueType->mValue.mTypeCode) &&
return (lhsConstExprValueType->mType == rhsConstExprValueType->mType) &&
(lhsConstExprValueType->mValue.mInt64 == rhsConstExprValueType->mValue.mInt64);
}
else