mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Ungate accepted parts of SE439
This commit is contained in:
@@ -1926,8 +1926,7 @@ ParserResult<Expr> Parser::parseExprPrimary(Diag<> ID, bool isExprBasic) {
|
||||
default:
|
||||
UnknownCharacter:
|
||||
checkForInputIncomplete();
|
||||
if (Context.LangOpts.hasFeature(Feature::TrailingComma) &&
|
||||
Tok.is(tok::eof) && Tok.getText() == ")") {
|
||||
if (Tok.is(tok::eof) && Tok.getText() == ")") {
|
||||
return nullptr;
|
||||
}
|
||||
// FIXME: offer a fixit: 'Self' -> 'self'
|
||||
@@ -2774,8 +2773,7 @@ ParserStatus Parser::parseClosureSignatureIfPresent(
|
||||
VD->setIsSelfParamCapture();
|
||||
|
||||
captureList.push_back(CLE);
|
||||
} while (HasNext && !(Context.LangOpts.hasFeature(Feature::TrailingComma) &&
|
||||
Tok.is(tok::r_square)));
|
||||
} while (HasNext && !Tok.is(tok::r_square));
|
||||
|
||||
// The capture list needs to be closed off with a ']'.
|
||||
SourceLoc rBracketLoc = Tok.getLoc();
|
||||
@@ -3295,12 +3293,13 @@ ParserStatus Parser::parseExprList(tok leftTok, tok rightTok,
|
||||
StructureMarkerRAII ParsingExprList(*this, Tok);
|
||||
|
||||
leftLoc = consumeToken(leftTok);
|
||||
return parseList(rightTok, leftLoc, rightLoc, /*AllowSepAfterLast=*/Context.LangOpts.hasFeature(Feature::TrailingComma),
|
||||
return parseList(rightTok, leftLoc, rightLoc, /*AllowSepAfterLast=*/true,
|
||||
rightTok == tok::r_paren ? diag::expected_rparen_expr_list
|
||||
: diag::expected_rsquare_expr_list,
|
||||
[&] () -> ParserStatus {
|
||||
return parseExprListElement(rightTok, isArgumentList, leftLoc, elts);
|
||||
});
|
||||
[&]() -> ParserStatus {
|
||||
return parseExprListElement(rightTok, isArgumentList,
|
||||
leftLoc, elts);
|
||||
});
|
||||
}
|
||||
|
||||
static bool isStartOfLabelledTrailingClosure(Parser &P) {
|
||||
|
||||
Reference in New Issue
Block a user