[Parse] Inline skipExtraTopLevelRBraces()

Removed from 'parseTopLevel()'. There's no particular reason to diagnose
it in 'parseTopLevel()'.
This commit is contained in:
Rintaro Ishizaki
2017-12-25 23:32:55 +09:00
parent 62ac618dc6
commit 39746a9e58
4 changed files with 9 additions and 25 deletions

View File

@@ -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) {