diff options
author | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-09-09 15:18:17 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@nokia.com> | 2010-09-09 15:26:43 +0200 |
commit | cacb0db0ebb47e88300c4359c6de272b87838e8e (patch) | |
tree | a90b8339eee8bb5dd2e4da0409b7f368f37dde02 /src/libs/cplusplus/ASTPath.cpp | |
parent | 6afb8d40776c60cc57807a0dad3a42f4cc09eb24 (diff) |
C++: fixed completion in braceless statements following a control statement.
- Changed generator to generate:
- Changed AST::lastToken to return 1 if there is none
- Changed Bind.cpp to set the scope of the block following a control
statement to extend upto (and not including) the first token after
the block. So basically, including any whitespace after the control
statement.
Reviewed-by: Roberto Raggi
Diffstat (limited to 'src/libs/cplusplus/ASTPath.cpp')
-rw-r--r-- | src/libs/cplusplus/ASTPath.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libs/cplusplus/ASTPath.cpp b/src/libs/cplusplus/ASTPath.cpp index 28f5437d8c..89f407895b 100644 --- a/src/libs/cplusplus/ASTPath.cpp +++ b/src/libs/cplusplus/ASTPath.cpp @@ -67,7 +67,9 @@ bool ASTPath::preVisit(AST *ast) unsigned firstToken = ast->firstToken(); unsigned lastToken = ast->lastToken(); - if (firstToken > 0 && lastToken > firstToken) { + if (firstToken > 0) { + Q_ASSERT(lastToken > firstToken); + unsigned startLine, startColumn; getTokenStartPosition(firstToken, &startLine, &startColumn); |