}
} else {
while (CurrentToken) {
- if (CurrentToken->is(tok::string_literal))
- // Mark these string literals as "implicit" literals, too, so that
+ if (CurrentToken->isNot(tok::comment))
+ // Mark these tokens as "implicit" string literals, so that
// they are not split or line-wrapped.
CurrentToken->Type = TT_ImplicitStringLiteral;
next();
// should not break the line).
IdentifierInfo *Info = CurrentToken->Tok.getIdentifierInfo();
if (Info && Info->getPPKeywordID() == tok::pp_import &&
- CurrentToken->Next && CurrentToken->Next->is(tok::string_literal)) {
+ CurrentToken->Next) {
next();
parseIncludeDirective();
return LT_Other;
"}");
}
+TEST_F(FormatTestJava, ImportDeclarations) {
+ verifyFormat("import some.really.loooooooooooooooooooooong.imported.Class;",
+ getStyleWithColumns(50));
+}
+
} // end namespace tooling
} // end namespace clang