summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorAlexander Kornienko <alexfh@google.com>2014-12-12 13:03:22 +0000
committerAlexander Kornienko <alexfh@google.com>2014-12-12 13:03:22 +0000
commitff2437fe849d3afb7851e63637b129bd94d8c2b2 (patch)
tree4b7313c77023fcdddb8a69227228df0f5619315f /clang/lib/Format/ContinuationIndenter.cpp
parent384095e65c9d383309d876d2b0595bd976215da3 (diff)
downloadbcm5719-llvm-ff2437fe849d3afb7851e63637b129bd94d8c2b2.tar.gz
bcm5719-llvm-ff2437fe849d3afb7851e63637b129bd94d8c2b2.zip
Don't break string literals in Java and JavaScript.
The proper way to break string literals in these languages is by inserting a "+" between parts which we don't support yet. So we disable string literal breaking until then. llvm-svn: 224120
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index e709cfbfc85..af4e1735dbf 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -923,6 +923,12 @@ static bool getRawStringLiteralPrefixPostfix(StringRef Text, StringRef &Prefix,
unsigned ContinuationIndenter::breakProtrudingToken(const FormatToken &Current,
LineState &State,
bool DryRun) {
+ // FIXME: String literal breaking is currently disabled for Java and JS, as
+ // it requires strings to be merged using "+" which we don't support.
+ if (Style.Language == FormatStyle::LK_Java ||
+ Style.Language == FormatStyle::LK_JavaScript)
+ return 0;
+
// Don't break multi-line tokens other than block comments. Instead, just
// update the state.
if (Current.isNot(TT_BlockComment) && Current.IsMultiline)
OpenPOWER on IntegriCloud