forked from qt-creator/qt-creator
Renamed the CompoundExpressionAST::compoundStatement.
This commit is contained in:
@@ -436,8 +436,8 @@ unsigned CompoundExpressionAST::lastToken() const
|
||||
{
|
||||
if (rparen_token)
|
||||
return rparen_token + 1;
|
||||
else if (compoundStatement)
|
||||
return compoundStatement->lastToken();
|
||||
else if (statement)
|
||||
return statement->lastToken();
|
||||
else
|
||||
return lparen_token + 1;
|
||||
}
|
||||
|
||||
@@ -963,13 +963,13 @@ class CPLUSPLUS_EXPORT CompoundExpressionAST: public ExpressionAST
|
||||
{
|
||||
public:
|
||||
unsigned lparen_token;
|
||||
CompoundStatementAST *compoundStatement;
|
||||
CompoundStatementAST *statement;
|
||||
unsigned rparen_token;
|
||||
|
||||
public:
|
||||
CompoundExpressionAST()
|
||||
: lparen_token(0)
|
||||
, compoundStatement(0)
|
||||
, statement(0)
|
||||
, rparen_token(0)
|
||||
{}
|
||||
|
||||
|
||||
@@ -277,8 +277,8 @@ CompoundExpressionAST *CompoundExpressionAST::clone(MemoryPool *pool) const
|
||||
{
|
||||
CompoundExpressionAST *ast = new (pool) CompoundExpressionAST;
|
||||
ast->lparen_token = lparen_token;
|
||||
if (compoundStatement)
|
||||
ast->compoundStatement = compoundStatement->clone(pool);
|
||||
if (statement)
|
||||
ast->statement = statement->clone(pool);
|
||||
ast->rparen_token = rparen_token;
|
||||
return ast;
|
||||
}
|
||||
|
||||
@@ -434,9 +434,9 @@ bool ASTMatcher::match(CompoundExpressionAST *node, CompoundExpressionAST *patte
|
||||
|
||||
pattern->lparen_token = node->lparen_token;
|
||||
|
||||
if (! pattern->compoundStatement)
|
||||
pattern->compoundStatement = node->compoundStatement;
|
||||
else if (! AST::match(node->compoundStatement, pattern->compoundStatement, this))
|
||||
if (! pattern->statement)
|
||||
pattern->statement = node->statement;
|
||||
else if (! AST::match(node->statement, pattern->statement, this))
|
||||
return false;
|
||||
|
||||
pattern->rparen_token = node->rparen_token;
|
||||
|
||||
@@ -208,7 +208,7 @@ void BaseSpecifierAST::accept0(ASTVisitor *visitor)
|
||||
void CompoundExpressionAST::accept0(ASTVisitor *visitor)
|
||||
{
|
||||
if (visitor->visit(this)) {
|
||||
accept(compoundStatement, visitor);
|
||||
accept(statement, visitor);
|
||||
}
|
||||
visitor->endVisit(this);
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ bool CheckExpression::visit(ThisExpressionAST *)
|
||||
|
||||
bool CheckExpression::visit(CompoundExpressionAST *ast)
|
||||
{
|
||||
_fullySpecifiedType = semantic()->check(ast->compoundStatement, _scope);
|
||||
_fullySpecifiedType = semantic()->check(ast->statement, _scope);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3573,12 +3573,12 @@ bool Parser::parsePrimaryExpression(ExpressionAST *&node)
|
||||
ast->lparen_token = consumeToken();
|
||||
StatementAST *statement = 0;
|
||||
parseCompoundStatement(statement);
|
||||
ast->compoundStatement = statement->asCompoundStatement();
|
||||
ast->statement = statement->asCompoundStatement();
|
||||
match(T_RPAREN, &ast->rparen_token);
|
||||
node = ast;
|
||||
if (ast->compoundStatement && ast->compoundStatement->statement_list) {
|
||||
if (ast->statement && ast->statement->statement_list) {
|
||||
// check that the last statement is an expression-statement
|
||||
StatementAST *lastStmt = ast->compoundStatement->statement_list->lastValue();
|
||||
StatementAST *lastStmt = ast->statement->statement_list->lastValue();
|
||||
if (!lastStmt || ! ast->asExpressionStatement())
|
||||
_translationUnit->error(cursor(),
|
||||
"expected an expression statement before token `%s'",
|
||||
|
||||
Reference in New Issue
Block a user