diff --git a/shared/cplusplus/AST.cpp b/shared/cplusplus/AST.cpp index 911af02e53c..ff19e4439b8 100644 --- a/shared/cplusplus/AST.cpp +++ b/shared/cplusplus/AST.cpp @@ -2796,10 +2796,15 @@ unsigned WhileStatementAST::firstToken() const unsigned WhileStatementAST::lastToken() const { - assert(0 && "review me"); if (statement) return statement->lastToken(); - return rparen_token + 1; + else if (rparen_token) + return rparen_token + 1; + else if (condition) + return condition->lastToken(); + else if (lparen_token) + return lparen_token + 1; + return while_token + 1; } CPLUSPLUS_END_NAMESPACE