mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
remove some old code that isn't doing anything useful in the testsuite,
but regresses parser recovery with a forthcoming patch I'm working on.
This commit is contained in:
@@ -48,15 +48,6 @@ static DefaultArgumentKind getDefaultArgKind(ExprHandle *init) {
|
||||
}
|
||||
}
|
||||
|
||||
static void recoverFromBadSelectorArgument(Parser &P) {
|
||||
while (P.Tok.isNot(tok::eof) && P.Tok.isNot(tok::r_paren) &&
|
||||
P.Tok.isNot(tok::l_brace) && P.Tok.isNot(tok::r_brace) &&
|
||||
!P.isStartOfStmt() && !P.isStartOfDecl()) {
|
||||
P.skipSingle();
|
||||
}
|
||||
P.consumeIf(tok::r_paren);
|
||||
}
|
||||
|
||||
void Parser::DefaultArgumentInfo::setFunctionContext(DeclContext *DC) {
|
||||
assert(DC->isLocalContext());
|
||||
for (auto context : ParsedContexts) {
|
||||
@@ -122,14 +113,11 @@ static ParserStatus parseDefaultArgument(Parser &P,
|
||||
|
||||
defaultArgs->HasDefaultArgument = true;
|
||||
|
||||
if (initR.hasCodeCompletion()) {
|
||||
recoverFromBadSelectorArgument(P);
|
||||
if (initR.hasCodeCompletion())
|
||||
return makeParserCodeCompletionStatus();
|
||||
}
|
||||
if (initR.isNull()) {
|
||||
recoverFromBadSelectorArgument(P);
|
||||
|
||||
if (initR.isNull())
|
||||
return makeParserError();
|
||||
}
|
||||
|
||||
init = ExprHandle::get(P.Context, initR.get());
|
||||
return ParserStatus();
|
||||
|
||||
Reference in New Issue
Block a user