From bdf1800d83eef2c3940ed93466d3387fe2e172ee Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Fri, 2 Jan 2009 16:10:00 +0100 Subject: [PATCH] Added `colon_token' to ClassSpecifierAST. --- shared/cplusplus/AST.h | 1 + shared/cplusplus/Parser.cpp | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/shared/cplusplus/AST.h b/shared/cplusplus/AST.h index c4b0f7fe76f..f9960f80d78 100644 --- a/shared/cplusplus/AST.h +++ b/shared/cplusplus/AST.h @@ -444,6 +444,7 @@ public: unsigned classkey_token; SpecifierAST *attributes; NameAST *name; + unsigned colon_token; BaseSpecifierAST *base_clause; unsigned lbrace_token; DeclarationAST *member_specifiers; diff --git a/shared/cplusplus/Parser.cpp b/shared/cplusplus/Parser.cpp index 549a74ce111..05836e9fca0 100644 --- a/shared/cplusplus/Parser.cpp +++ b/shared/cplusplus/Parser.cpp @@ -1196,9 +1196,12 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node) const bool previousInFunctionBody = _inFunctionBody; _inFunctionBody = false; + unsigned colon_token = 0; + if (LA() == T_COLON || LA() == T_LBRACE) { BaseSpecifierAST *base_clause = 0; if (LA() == T_COLON) { + colon_token = cursor(); parseBaseClause(base_clause); if (LA() != T_LBRACE) { _translationUnit->error(cursor(), "expected `{' before `%s'", tok().spell()); @@ -1216,6 +1219,7 @@ bool Parser::parseClassSpecifier(SpecifierAST *&node) ast->classkey_token = classkey_token; ast->attributes = attributes; ast->name = name; + ast->colon_token = colon_token; ast->base_clause = base_clause; if (LA() == T_LBRACE)