1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Fixed to tuple name parsing

This commit is contained in:
Brian Fiete 2020-09-29 05:11:23 -07:00
parent 67556c2ff6
commit fc0fcd103f
2 changed files with 6 additions and 3 deletions

View file

@ -357,7 +357,7 @@ BfParser::BfParser(BfSystem* bfSystem, BfProject* bfProject) : BfSource(bfSystem
mLineStart = 0; mLineStart = 0;
//mCurToken = (BfSyntaxToken)0; //mCurToken = (BfSyntaxToken)0;
mToken = BfToken_None; mToken = BfToken_None;
mSyntaxToken = BfSyntaxToken_Token; mSyntaxToken = BfSyntaxToken_None;
mTokenStart = 0; mTokenStart = 0;
mTokenEnd = 0; mTokenEnd = 0;
mLineNum = 0; mLineNum = 0;
@ -1360,6 +1360,8 @@ double BfParser::ParseLiteralDouble()
void BfParser::NextToken(int endIdx) void BfParser::NextToken(int endIdx)
{ {
auto prevToken = mToken;
mToken = BfToken_None; mToken = BfToken_None;
if (mSyntaxToken == BfSyntaxToken_EOF) if (mSyntaxToken == BfSyntaxToken_EOF)
Fail("Unexpected end of file"); Fail("Unexpected end of file");
@ -2281,7 +2283,7 @@ void BfParser::NextToken(int endIdx)
default: default:
if (((c >= '0') && (c <= '9')) || (c == '-')) if (((c >= '0') && (c <= '9')) || (c == '-'))
{ {
bool prevIsDot = (mSrcIdx > 1) && (mSrc[mSrcIdx - 2] == '.'); bool prevIsDot = prevToken == BfToken_Dot;
if (c == '-') if (c == '-')
{ {

View file

@ -17,6 +17,7 @@ class BfProject;
enum BfSyntaxToken enum BfSyntaxToken
{ {
BfSyntaxToken_None,
BfSyntaxToken_Token, BfSyntaxToken_Token,
BfSyntaxToken_Identifier, BfSyntaxToken_Identifier,
BfSyntaxToken_CharQuote, BfSyntaxToken_CharQuote,