diff options
author | Daniel Jasper <djasper@google.com> | 2015-01-14 10:02:49 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-01-14 10:02:49 +0000 |
commit | 16dbe0bc4427e7b92b34d156603e60a89fd5f6ff (patch) | |
tree | 95e83bb4b4aa731578d23ab31f7674f1f859192e /clang | |
parent | 404658aeded17d753efdb508f850a8af3c7f5f5a (diff) | |
download | bcm5719-llvm-16dbe0bc4427e7b92b34d156603e60a89fd5f6ff.tar.gz bcm5719-llvm-16dbe0bc4427e7b92b34d156603e60a89fd5f6ff.zip |
clang-format: [Java] Understand "import static".
llvm-svn: 225965
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 3 | ||||
-rw-r--r-- | clang/unittests/Format/FormatTestJava.cpp | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index b2f9bd2cc51..34d8835c763 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -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; diff --git a/clang/unittests/Format/FormatTestJava.cpp b/clang/unittests/Format/FormatTestJava.cpp index e0f2b51f068..9b3b9933572 100644 --- a/clang/unittests/Format/FormatTestJava.cpp +++ b/clang/unittests/Format/FormatTestJava.cpp @@ -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) { |