Add list expressions in for statement
This commit is contained in:
parent
a2ca0de809
commit
235cbbc227
|
@ -8978,6 +8978,7 @@ Expression* Parser::ParseListExpression(bool lhs)
|
||||||
return ParseBinaryFoldExpression(nexp);
|
return ParseBinaryFoldExpression(nexp);
|
||||||
|
|
||||||
nexp->mRight = ParseListExpression(false);
|
nexp->mRight = ParseListExpression(false);
|
||||||
|
nexp->mDecType = nexp->mRight->mDecType;
|
||||||
exp = nexp;
|
exp = nexp;
|
||||||
}
|
}
|
||||||
return exp;
|
return exp;
|
||||||
|
@ -9259,7 +9260,7 @@ Expression* Parser::ParseStatement(void)
|
||||||
|
|
||||||
// Assignment
|
// Assignment
|
||||||
if (mScanner->mToken != TK_SEMICOLON)
|
if (mScanner->mToken != TK_SEMICOLON)
|
||||||
initExp = CleanupExpression(ParseExpression(true));
|
initExp = CleanupExpression(ParseListExpression(true));
|
||||||
|
|
||||||
if ((mCompilerOptions & COPT_CPLUSPLUS) && ConsumeTokenIf(TK_COLON))
|
if ((mCompilerOptions & COPT_CPLUSPLUS) && ConsumeTokenIf(TK_COLON))
|
||||||
{
|
{
|
||||||
|
@ -9445,7 +9446,7 @@ Expression* Parser::ParseStatement(void)
|
||||||
|
|
||||||
// Condition
|
// Condition
|
||||||
if (mScanner->mToken != TK_SEMICOLON)
|
if (mScanner->mToken != TK_SEMICOLON)
|
||||||
conditionExp = CoerceExpression(CleanupExpression(ParseExpression(false)), TheBoolTypeDeclaration);
|
conditionExp = CoerceExpression(CleanupExpression(ParseListExpression(false)), TheBoolTypeDeclaration);
|
||||||
|
|
||||||
if (mScanner->mToken == TK_SEMICOLON)
|
if (mScanner->mToken == TK_SEMICOLON)
|
||||||
mScanner->NextToken();
|
mScanner->NextToken();
|
||||||
|
@ -9454,7 +9455,7 @@ Expression* Parser::ParseStatement(void)
|
||||||
|
|
||||||
// Iteration
|
// Iteration
|
||||||
if (mScanner->mToken != TK_CLOSE_PARENTHESIS)
|
if (mScanner->mToken != TK_CLOSE_PARENTHESIS)
|
||||||
iterateExp = CleanupExpression(ParseExpression(false));
|
iterateExp = CleanupExpression(ParseListExpression(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
ConsumeToken(TK_CLOSE_PARENTHESIS);
|
ConsumeToken(TK_CLOSE_PARENTHESIS);
|
||||||
|
|
Loading…
Reference in New Issue