Revert "[clang-format] Keep protobuf "package" statement on one line"
This reverts commit r356835. This patch causes a regression, see the
test below:
verifyFormat("// Detached comment\n\n"
"// Leading comment\n"
"syntax = \"proto2\"; // trailing comment\n\n"
"// in foo.bar package\n"
"package foo.bar; // foo.bar package\n");
llvm-svn: 356912
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index a3000a8..ccf5e51 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1119,10 +1119,10 @@
return LT_ImportStatement;
}
- // In .proto files, top-level options and package statements are very
- // similar to import statements and should not be line-wrapped.
+ // In .proto files, top-level options are very similar to import statements
+ // and should not be line-wrapped.
if (Style.Language == FormatStyle::LK_Proto && Line.Level == 0 &&
- CurrentToken->isOneOf(Keywords.kw_option, Keywords.kw_package)) {
+ CurrentToken->is(Keywords.kw_option)) {
next();
if (CurrentToken && CurrentToken->is(tok::identifier))
return LT_ImportStatement;