summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/ContinuationIndenter.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2017-02-03 14:32:38 +0000
committerDaniel Jasper <djasper@google.com>2017-02-03 14:32:38 +0000
commitc06f6da34e0a5d3bf4026201c72afee461da014b (patch)
treeafd4366b55f6d9092d9683663cdc826b51b7ddcc /clang/lib/Format/ContinuationIndenter.cpp
parent776b417634b2993a68d454d0d7581b4e937108c3 (diff)
downloadbcm5719-llvm-c06f6da34e0a5d3bf4026201c72afee461da014b.tar.gz
bcm5719-llvm-c06f6da34e0a5d3bf4026201c72afee461da014b.zip
clang-format: [JS] Fix bugs in parsing and aligning template strings.
llvm-svn: 294009
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index cd39c54e353..173ca17c2a3 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -837,8 +837,8 @@ unsigned ContinuationIndenter::moveStateToNextToken(LineState &State,
}
moveStatePastFakeLParens(State, Newline);
- moveStatePastScopeOpener(State, Newline);
moveStatePastScopeCloser(State);
+ moveStatePastScopeOpener(State, Newline);
moveStatePastFakeRParens(State);
if (Current.isStringLiteral() && State.StartOfStringLiteral == 0)
@@ -1060,7 +1060,7 @@ void ContinuationIndenter::moveStatePastScopeCloser(LineState &State) {
// If we encounter a closing ), ], } or >, we can remove a level from our
// stacks.
if (State.Stack.size() > 1 &&
- (Current.isOneOf(tok::r_paren, tok::r_square) ||
+ (Current.isOneOf(tok::r_paren, tok::r_square, TT_TemplateString) ||
(Current.is(tok::r_brace) && State.NextToken != State.Line->First) ||
State.NextToken->is(TT_TemplateCloser)))
State.Stack.pop_back();
OpenPOWER on IntegriCloud