1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +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,15 +2357,31 @@ namespace Beefy.utils
mNextKeys.Reserve(guessItems);
bool isJson = false;
bool mayBeJsonArray = false;
for (char8 c in mSource.RawChars)
{
if (c.IsWhiteSpace)
continue;
if (c == '{')
isJson = true;
if (c == '[')
isJson = true;
break;
if (mayBeJsonArray)
{
if (c == '[')
continue; // Still ambiguous
if ((c == '{') || (c == '"'))
isJson = true;
break;
}
else
{
if (c == '{')
isJson = true;
if (c == '[')
{
mayBeJsonArray = true;
continue;
}
break;
}
}
int32 aLineNum = 1;