summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorKrasimir Georgiev <krasimir@google.com>2019-05-10 09:15:11 +0000
committerKrasimir Georgiev <krasimir@google.com>2019-05-10 09:15:11 +0000
commit4dea1378eac0224aebaf69c5b5000130afe390bf (patch)
tree3ed0677710c794a53033b3c7f0cd0349d0568dc7 /clang/lib/Format/TokenAnnotator.cpp
parenta2d876c95a8879181ad9d1f3ea7b397bb3e4ba8e (diff)
downloadbcm5719-llvm-4dea1378eac0224aebaf69c5b5000130afe390bf.tar.gz
bcm5719-llvm-4dea1378eac0224aebaf69c5b5000130afe390bf.zip
Revert "Revert "[clang-format] Keep protobuf "package" statement on one line""
Summary: Top-level "package" and "import" statements should generally be kept on one line, for all languages. ---- This reverts commit rL356912. The regression from rL356835 was fixed via rC358275. Reviewers: krasimir, sammccall, MyDeveloperDay, xinz, dchai, klimek Reviewed By: krasimir, xinz, dchai Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60661 llvm-svn: 360411
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 ddaacaab777..4e255700d4d 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 are very similar to import statements
- // and should not be line-wrapped.
+ // In .proto files, top-level options and package statements are very
+ // similar to import statements and should not be line-wrapped.
if (Style.Language == FormatStyle::LK_Proto && Line.Level == 0 &&
- CurrentToken->is(Keywords.kw_option)) {
+ CurrentToken->isOneOf(Keywords.kw_option, Keywords.kw_package)) {
next();
if (CurrentToken && CurrentToken->is(tok::identifier)) {
while (CurrentToken)
OpenPOWER on IntegriCloud