summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorHaojian Wu <hokein@google.com>2019-03-25 15:46:07 +0000
committerHaojian Wu <hokein@google.com>2019-03-25 15:46:07 +0000
commitae3fefe3978237a8b71a6a08a11caab4485b87a4 (patch)
tree4951b36e64f01f89b9b7ec6b567dc76be32382cf /clang/lib/Format/TokenAnnotator.cpp
parent040f94cc7e9e010a332e2dcbfd119e7fecb176b3 (diff)
downloadbcm5719-llvm-ae3fefe3978237a8b71a6a08a11caab4485b87a4.tar.gz
bcm5719-llvm-ae3fefe3978237a8b71a6a08a11caab4485b87a4.zip
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
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index a3000a8fdeb..ccf5e51576d 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1119,10 +1119,10 @@ public:
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;
OpenPOWER on IntegriCloud