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

Allowed implicit int64 literals

This commit is contained in:
Brian Fiete 2020-08-29 06:24:11 -07:00
parent 243dfc09c4
commit cb2479083a

View file

@ -2440,8 +2440,15 @@ void BfParser::NextToken(int endIdx)
mLiteral.mInt64 = val;
mLiteral.mTypeCode = BfTypeCode_IntUnknown;
if ((hadOverflow) || (val < -0x80000000LL) || (val > 0xFFFFFFFFLL))
mPassInstance->FailAt("Value doesn't fit into int32", mSourceData, mTokenStart, mSrcIdx - mTokenStart);
if (hadOverflow)
{
mPassInstance->FailAt("Value doesn't fit into int64", mSourceData, mTokenStart, mSrcIdx - mTokenStart);
mLiteral.mTypeCode = BfTypeCode_Int64;
}
else if ((val < -0x80000000LL) || (val > 0xFFFFFFFFLL))
{
mLiteral.mTypeCode = BfTypeCode_Int64;
}
else
{
if ((numberBase == 0x10) && (hexDigits == 7))