summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorPaul Hoad <mydeveloperday@gmail.com>2019-03-23 14:43:41 +0000
committerPaul Hoad <mydeveloperday@gmail.com>2019-03-23 14:43:41 +0000
commitf5e52738fe9d991e065233b5b239ba491d76fe3b (patch)
treedf65b292f042eb0631321cbdfddd282318f9d879 /clang/lib/Format/TokenAnnotator.cpp
parentc6deae452197631a4530a50df266cdf5063b601e (diff)
downloadbcm5719-llvm-f5e52738fe9d991e065233b5b239ba491d76fe3b.tar.gz
bcm5719-llvm-f5e52738fe9d991e065233b5b239ba491d76fe3b.zip
[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. Reviewers: sammccall, krasimir, MyDeveloperDay Reviewed By: MyDeveloperDay Subscribers: MyDeveloperDay, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59627 Patch By: dchai (Donald Chai) llvm-svn: 356835
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 ccf5e51576d..a3000a8fdeb 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))
return LT_ImportStatement;
OpenPOWER on IntegriCloud