diff options
author | Krasimir Georgiev <krasimir@google.com> | 2019-05-10 09:15:11 +0000 |
---|---|---|
committer | Krasimir Georgiev <krasimir@google.com> | 2019-05-10 09:15:11 +0000 |
commit | 4dea1378eac0224aebaf69c5b5000130afe390bf (patch) | |
tree | 3ed0677710c794a53033b3c7f0cd0349d0568dc7 /clang/lib/Format/TokenAnnotator.cpp | |
parent | a2d876c95a8879181ad9d1f3ea7b397bb3e4ba8e (diff) | |
download | bcm5719-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.cpp | 6 |
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) |