This is an archive of the discontinued LLVM Phabricator instance.

[clang-format][NFC] Merge another two calls to isOneOf
ClosedPublic

Authored by HazardyKnusperkeks on Dec 3 2021, 12:02 PM.

Diff Detail

Event Timeline

HazardyKnusperkeks requested review of this revision.Dec 3 2021, 12:02 PM
HazardyKnusperkeks created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptDec 3 2021, 12:02 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius added inline comments.Dec 3 2021, 12:49 PM
clang/lib/Format/ContinuationIndenter.cpp
1294–1296

Unrelated to your change, it only shed light on this:
This condition looks strange to me. How can Previous be at the same time two different TokenTypes (?), for instance, both TT_BinaryOperator and TT_DictLiteral?

Shouldn't it be this?

clang/lib/Format/ContinuationIndenter.cpp
1294–1296

Yeah, I will update it.

MyDeveloperDay accepted this revision.Dec 4 2021, 7:03 AM
MyDeveloperDay added inline comments.
clang/lib/Format/ContinuationIndenter.cpp
1294–1296

This is in my view one of the reasons why I personally like it when we comment the condition with an example and don't have these huge compound expressions.

Often they are covering corner cases. (we should call them out)

This revision is now accepted and ready to land.Dec 4 2021, 7:03 AM
HazardyKnusperkeks marked 2 inline comments as done.

Incorporated feedback.

curdeius accepted this revision.Dec 4 2021, 12:25 PM

LGTM.

owenpan accepted this revision.Dec 4 2021, 2:14 PM
MyDeveloperDay accepted this revision.Dec 6 2021, 1:35 AM