1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-13 22:04:09 +02:00

Json array detection fix

This commit is contained in:
Brian Fiete 2021-09-10 14:09:22 -07:00
parent a0343678bc
commit 507fb82e4a

View file

@ -2357,16 +2357,32 @@ namespace Beefy.utils
mNextKeys.Reserve(guessItems);
bool isJson = false;
bool mayBeJsonArray = false;
for (char8 c in mSource.RawChars)
{
if (c.IsWhiteSpace)
continue;
if (mayBeJsonArray)
{
if (c == '[')
continue; // Still ambiguous
if ((c == '{') || (c == '"'))
isJson = true;
break;
}
else
{
if (c == '{')
isJson = true;
if (c == '[')
isJson = true;
{
mayBeJsonArray = true;
continue;
}
break;
}
}
int32 aLineNum = 1;
int32 anIdx = 0;