}
} else {
while (CurrentToken != NULL) {
+ if (CurrentToken->is(tok::string_literal))
+ // Mark these string literals as "implicit" literals, too, so that
+ // they are not split or line-wrapped.
+ CurrentToken->Type = TT_ImplicitStringLiteral;
next();
}
}
if (Right.is(tok::r_paren) || Right.is(tok::greater))
return false;
+ if (Left.is(tok::identifier) && Right.is(tok::string_literal))
+ return true;
return (isBinaryOperator(Left) && Left.isNot(tok::lessless)) ||
Left.is(tok::comma) || Right.is(tok::lessless) ||
Right.is(tok::arrow) || Right.is(tok::period) ||
verifyFormat("a = a + \"a\"\n"
" \"a\"\n"
" \"a\";");
+
+ verifyFormat(
+ "#define LL_FORMAT \"ll\"\n"
+ "printf(\"aaaaa: %d, bbbbbb: %\" LL_FORMAT \"d, cccccccc: %\" LL_FORMAT\n"
+ " \"d, ddddddddd: %\" LL_FORMAT \"d\");");
}
TEST_F(FormatTest, AlignsPipes) {
"#include \"string.h\"\n"
"#include \"string.h\"\n"
"#include <a-a>\n"
- "#include < path with space >\n");
+ "#include < path with space >\n"
+ "#include \"some very long include paaaaaaaaaaaaaaaaaaaaaaath\"",
+ getLLVMStyleWithColumns(35));
verifyFormat("#import <string>");
verifyFormat("#import <a/b/c.h>");