1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Improved tuple member parsing

This commit is contained in:
Brian Fiete 2020-09-28 18:02:10 -07:00
parent c5b48a1dc1
commit 395cac905d

View file

@ -2399,6 +2399,8 @@ void BfParser::NextToken(int endIdx)
} }
} }
bool endNumber = false;
// The 'prevIsDot' helps tuple lookups like "tuple.0.0", interpreting those as two integers rather than a float // The 'prevIsDot' helps tuple lookups like "tuple.0.0", interpreting those as two integers rather than a float
if (((c == '.') && (!prevIsDot)) || (hasExp)) if (((c == '.') && (!prevIsDot)) || (hasExp))
{ {
@ -2510,8 +2512,13 @@ void BfParser::NextToken(int endIdx)
} }
return; return;
} }
else if (c == '.')
endNumber = true;
if (IsWhitespaceOrPunctuation(c)) if (IsWhitespaceOrPunctuation(c))
endNumber = true;
if (endNumber)
{ {
mTokenEnd = mSrcIdx - 1; mTokenEnd = mSrcIdx - 1;
mSrcIdx--; mSrcIdx--;