forked from OSchip/llvm-project
clang-format/java: Always put space after `assert` keyword.
Previously, it was missing if the expression after the assert started with a (. llvm-svn: 314172
This commit is contained in:
parent
2eccdab308
commit
e8eba3716c
|
@ -2185,6 +2185,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
|
|||
const FormatToken &Right) {
|
||||
if (Left.is(tok::kw_return) && Right.isNot(tok::semi))
|
||||
return true;
|
||||
if (Left.is(Keywords.kw_assert) && Style.Language == FormatStyle::LK_Java)
|
||||
return true;
|
||||
if (Style.ObjCSpaceAfterProperty && Line.Type == LT_ObjCProperty &&
|
||||
Left.Tok.getObjCKeywordID() == tok::objc_property)
|
||||
return true;
|
||||
|
|
|
@ -412,6 +412,7 @@ TEST_F(FormatTestJava, SynchronizedKeyword) {
|
|||
|
||||
TEST_F(FormatTestJava, AssertKeyword) {
|
||||
verifyFormat("assert a && b;");
|
||||
verifyFormat("assert (a && b);");
|
||||
}
|
||||
|
||||
TEST_F(FormatTestJava, PackageDeclarations) {
|
||||
|
|
Loading…
Reference in New Issue