mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Parse] Inline skipExtraTopLevelRBraces()
Removed from 'parseTopLevel()'. There's no particular reason to diagnose it in 'parseTopLevel()'.
This commit is contained in:
@@ -196,8 +196,6 @@ bool Parser::parseTopLevel() {
|
||||
// Parse the body of the file.
|
||||
SmallVector<ASTNode, 128> Items;
|
||||
|
||||
skipExtraTopLevelRBraces();
|
||||
|
||||
// If we are in SIL mode, and if the first token is the start of a sil
|
||||
// declaration, parse that one SIL function and return to the top level. This
|
||||
// allows type declarations and other things to be parsed, name bound, and
|
||||
@@ -280,19 +278,6 @@ bool Parser::parseTopLevel() {
|
||||
return FoundTopLevelCodeToExecute;
|
||||
}
|
||||
|
||||
bool Parser::skipExtraTopLevelRBraces() {
|
||||
if (!Tok.is(tok::r_brace))
|
||||
return false;
|
||||
while (Tok.is(tok::r_brace)) {
|
||||
diagnose(Tok, diag::extra_rbrace)
|
||||
.fixItRemove(Tok.getLoc());
|
||||
consumeToken();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Optional<StringRef>
|
||||
getStringLiteralIfNotInterpolated(Parser &P, SourceLoc Loc, const Token &Tok,
|
||||
StringRef DiagText) {
|
||||
|
||||
Reference in New Issue
Block a user