clang-format: [Java] Understand "import static".

llvm-svn: 225965
This commit is contained in:
Daniel Jasper
2015-01-14 10:02:49 +00:00
parent 404658aede
commit 16dbe0bc44
2 changed files with 4 additions and 1 deletions

View File

@@ -621,7 +621,8 @@ public:
CurrentToken->is(Keywords.kw_package)) ||
(Info && Info->getPPKeywordID() == tok::pp_import &&
CurrentToken->Next &&
CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier))) {
CurrentToken->Next->isOneOf(tok::string_literal, tok::identifier,
tok::kw_static))) {
next();
parseIncludeDirective();
return LT_ImportStatement;

View File

@@ -369,6 +369,8 @@ TEST_F(FormatTestJava, PackageDeclarations) {
TEST_F(FormatTestJava, ImportDeclarations) {
verifyFormat("import some.really.loooooooooooooooooooooong.imported.Class;",
getStyleWithColumns(50));
verifyFormat("import static some.really.looooooooooooooooong.imported.Class;",
getStyleWithColumns(50));
}
TEST_F(FormatTestJava, MethodDeclarations) {