1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 11:38:21 +02:00

Better case expression parsing, better enum errors

This commit is contained in:
Brian Fiete 2022-02-13 21:55:31 -05:00
parent ce8899f1a7
commit 322b83d1c6
3 changed files with 25 additions and 10 deletions

View file

@ -1124,15 +1124,16 @@ bool BfPassInstance::WantsRangeRecorded(BfSourceData* bfSource, int srcIdx, int
if (bfSource == NULL)
return true;
if (!mErrors.IsEmpty())
{
// If the last error had a range that was a subset of this one, then just keep the first error
// This helps reduce cascading errors to their root cause
auto lastError = mErrors.back();
if ((lastError->mSource == bfSource) && (isWarning == lastError->mIsWarning) && (isDeferred == lastError->mIsDeferred) &&
(lastError->mSrcStart >= srcIdx) && (lastError->mSrcEnd <= srcIdx + srcLen))
return false;
}
//TODO: Was this useful, or does 'var' resolution do this better?
// if (!mErrors.IsEmpty())
// {
// // If the last error had a range that was a subset of this one, then just keep the first error
// // This helps reduce cascading errors to their root cause
// auto lastError = mErrors.back();
// if ((lastError->mSource == bfSource) && (isWarning == lastError->mIsWarning) && (isDeferred == lastError->mIsDeferred) &&
// (lastError->mSrcStart >= srcIdx) && (lastError->mSrcEnd <= srcIdx + srcLen))
// return false;
// }
// Don't record errors that have already occurred at this location
BfErrorBase checkError;