Skip to content

Commit 6212f0d

Browse files
authored
Merge pull request #5759 from CodaFi/end-of-guile
[Parse] Check for the presence of EOF before charging ahead with a brace skip
2 parents 5e019e7 + bb434eb commit 6212f0d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5625,11 +5625,12 @@ Parser::parseDeclPrecedenceGroup(ParseDeclOptions flags,
56255625
if (parseIdentifier(name, nameLoc, diag::expected_precedencegroup_name)) {
56265626
// If the identifier is missing or a keyword or something, try to skip
56275627
// skip the entire body.
5628-
if (consumeIf(tok::l_brace) ||
5629-
(peekToken().is(tok::l_brace), consumeToken(),
5630-
consumeIf(tok::l_brace))) {
5628+
if (consumeIf(tok::l_brace)) {
56315629
skipUntilDeclRBrace();
56325630
(void) consumeIf(tok::r_brace);
5631+
} else if (Tok.isNot(tok::eof) && peekToken().is(tok::l_brace)) {
5632+
consumeToken();
5633+
skipBracedBlock(*this);
56335634
}
56345635
return nullptr;
56355636
}

0 commit comments

Comments
 (0)