diff options
author | Daniel Jasper <djasper@google.com> | 2017-02-03 14:32:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2017-02-03 14:32:38 +0000 |
commit | c06f6da34e0a5d3bf4026201c72afee461da014b (patch) | |
tree | afd4366b55f6d9092d9683663cdc826b51b7ddcc /clang/lib/Format/ContinuationIndenter.cpp | |
parent | 776b417634b2993a68d454d0d7581b4e937108c3 (diff) | |
download | bcm5719-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.cpp | 4 |
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(); |