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

Merge pull request #2179 from Fusioon/Impl-2147

Add error on unpaired closing brace in string interpolation
This commit is contained in:
Brian Fiete 2025-03-08 11:03:06 -08:00 committed by GitHub
commit 432776c650
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2323,6 +2323,11 @@ void BfParser::NextToken(int endIdx, bool outerIsInterpolate, bool disablePrepro
{
for (int i = 0; i < braceCount - 1; i++)
strLiteral += '}';
if ((((isClosingBrace) && (braceCount > 1) && (braceCount % 2 == 0)) || ((!isClosingBrace)) && (braceCount % 2 == 1)))
{
mPassInstance->FailAt("Unpaired closing brace.", mSourceData, mSrcIdx - 1, 1);
}
}
else
{