Skip to content

Commit 0af2614

Browse files
committed
[clang-format][NFC] Use UnwrappedLineParser::eof() whenever possible
1 parent 4eb66f7 commit 0af2614

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

clang/lib/Format/UnwrappedLineParser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ bool UnwrappedLineParser::parseModuleImport() {
13571357
// Handle import <foo/bar.h> as we would an include statement.
13581358
else if (FormatTok->is(tok::less)) {
13591359
nextToken();
1360-
while (!FormatTok->isOneOf(tok::semi, tok::greater, tok::eof)) {
1360+
while (!FormatTok->isOneOf(tok::semi, tok::greater) && !eof()) {
13611361
// Mark tokens up to the trailing line comments as implicit string
13621362
// literals.
13631363
if (FormatTok->isNot(tok::comment) &&
@@ -3106,7 +3106,7 @@ void UnwrappedLineParser::parseTryCatch() {
31063106
parseParens();
31073107
continue;
31083108
}
3109-
if (FormatTok->isOneOf(tok::semi, tok::r_brace, tok::eof)) {
3109+
if (FormatTok->isOneOf(tok::semi, tok::r_brace) || eof()) {
31103110
if (Style.RemoveBracesLLVM)
31113111
NestedTooDeep.pop_back();
31123112
return;

0 commit comments

Comments
 (0)