Previous.is(tok::l_brace) && !Current.isOneOf(tok::r_brace, tok::comment))
return true;
+ if (Current.is(tok::lessless) && Previous.is(tok::identifier) &&
+ Previous.TokenText == "endl")
+ return true;
+
return false;
}
return true;
if (Left.is(TT_ObjCBlockLBrace) && !Style.AllowShortBlocksOnASingleLine)
return true;
- if (Right.is(tok::lessless) && Left.is(tok::identifier) &&
- Left.TokenText == "endl")
- return true;
if (Style.Language == FormatStyle::LK_JavaScript) {
// FIXME: This might apply to other languages and token kinds.
"}");
// Handle 'endl'.
- verifyFormat("llvm::errs() << aaaa << endl\n"
- " << bbbb << endl;");
+ verifyFormat("llvm::errs() << aaaaaaaaaaaaaaaaaaaaaa << endl\n"
+ " << bbbbbbbbbbbbbbbbbbbbbb << endl;");
+ verifyFormat("llvm::errs() << endl << bbbbbbbbbbbbbbbbbbbbbb << endl;");
}
TEST_F(FormatTest, UnderstandsEquals) {