summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-11-23 16:46:28 +0000
committerDaniel Jasper <djasper@google.com>2014-11-23 16:46:28 +0000
commit616de864da6ae41d08c5baf40f35c7307b21fd95 (patch)
treeb49da7beac9e7e0f68e98780ea35bd86e90e2467 /clang/lib/Format/ContinuationIndenter.cpp
parent6de72e5b0ccd02f1f750b136b92ff65206cc6a67 (diff)
downloadbcm5719-llvm-616de864da6ae41d08c5baf40f35c7307b21fd95.tar.gz
bcm5719-llvm-616de864da6ae41d08c5baf40f35c7307b21fd95.zip
clang-format: [JS] Support Closure's module statements.
These are like import statements and should not be line-wrapped. Minor restructuring of the handling of other import statements. llvm-svn: 222637
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 825a88ebae0..f4c4522aa18 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -986,8 +986,9 @@ unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken &Current,
if (Current.Type != TT_BlockComment && Current.IsMultiline)
return addMultilineToken(Current, State);
- // Don't break implicit string literals.
- if (Current.Type == TT_ImplicitStringLiteral)
+ // Don't break implicit string literals or import statements.
+ if (Current.Type == TT_ImplicitStringLiteral ||
+ State.Line->Type == LT_ImportStatement)
return 0;
if (!Current.isStringLiteral() && !Current.is(tok::comment))
OpenPOWER on IntegriCloud