[Parse] Remove special handling for .<keyword><code-complete> (#18869)

At the time this logic was introduced in 8f83ca67, `<expr>.<keyword>` wasn't
allowed. Now that SE-0071 has been implemented, this logic doesn't provide any
positive effects.
This commit is contained in:
Rintaro Ishizaki
2018-08-22 13:37:08 +09:00
committed by GitHub
parent 509b672b17
commit 1155adeef1
2 changed files with 32 additions and 11 deletions

View File

@@ -1154,17 +1154,6 @@ Parser::parseExprPostfixSuffix(ParserResult<Expr> Result, bool isExprBasic,
// fallthrough to an UnresolvedDotExpr.
}
// If we have '.<keyword><code_complete>', try to recover by creating
// an identifier with the same spelling as the keyword.
if (Tok.isKeyword() && peekToken().is(tok::code_complete)) {
Identifier Name = Context.getIdentifier(Tok.getText());
Result = makeParserResult(new (Context) UnresolvedDotExpr(
Result.get(), TokLoc, Name, DeclNameLoc(Tok.getLoc()),
/*Implicit=*/false));
consumeToken();
// Fall into the next code completion handler.
}
// Handle "x.<tab>" for code completion.
if (Tok.is(tok::code_complete)) {
if (CodeCompletion && Result.isNonNull()) {