diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-09-21 20:51:25 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-09-21 20:51:25 +0000 |
commit | 791215b7a24666912c0b71175d2ca5ba082f666e (patch) | |
tree | 4f0dd84cffc925b37b0986ba06123638eb8082e0 /lib/Parse/ParseStmt.cpp | |
parent | 90b4fd48a6b42c2fc7b162a5e61e5f8bfa17d4ee (diff) |
Code completion for ordinary names when we're starting a declaration, expression, or statement
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseStmt.cpp')
-rw-r--r-- | lib/Parse/ParseStmt.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Parse/ParseStmt.cpp b/lib/Parse/ParseStmt.cpp index 4fdcf2a077..907ca802b4 100644 --- a/lib/Parse/ParseStmt.cpp +++ b/lib/Parse/ParseStmt.cpp @@ -90,6 +90,11 @@ Parser::ParseStatementOrDeclaration(bool OnlyStatement) { return ParseObjCAtStatement(AtLoc); } + case tok::code_completion: + Actions.CodeCompleteOrdinaryName(CurScope); + ConsumeToken(); + return ParseStatementOrDeclaration(OnlyStatement); + case tok::identifier: if (NextToken().is(tok::colon)) { // C99 6.8.1: labeled-statement // identifier ':' statement @@ -918,6 +923,11 @@ Parser::OwningStmtResult Parser::ParseForStatement() { OwningStmtResult FirstPart(Actions); OwningExprResult SecondPart(Actions), ThirdPart(Actions); + if (Tok.is(tok::code_completion)) { + Actions.CodeCompleteOrdinaryName(CurScope); + ConsumeToken(); + } + // Parse the first part of the for specifier. if (Tok.is(tok::semi)) { // for (; // no first part, eat the ';'. |