diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-09-01 16:29:06 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-09-01 16:29:06 +0000 |
| commit | ef2abedb8a769fd36f6bf297c7dca6ba0fd3671f (patch) | |
| tree | e9a6b5da4df35be0858459207ed982a777fd4d0a /lib/Format/WhitespaceManager.cpp | |
| parent | a75fa8aaf2005c6cb7561a9aa5129a38075939a4 (diff) | |
Notes
Diffstat (limited to 'lib/Format/WhitespaceManager.cpp')
| -rw-r--r-- | lib/Format/WhitespaceManager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/Format/WhitespaceManager.cpp b/lib/Format/WhitespaceManager.cpp index b1a5f1eab552..377ec3a681b6 100644 --- a/lib/Format/WhitespaceManager.cpp +++ b/lib/Format/WhitespaceManager.cpp @@ -246,12 +246,12 @@ AlignTokenSequence(unsigned Start, unsigned End, unsigned Column, F &&Matches, for (unsigned i = Start; i != End; ++i) { if (ScopeStack.size() != 0 && - Changes[i].nestingAndIndentLevel() < - Changes[ScopeStack.back()].nestingAndIndentLevel()) + Changes[i].indentAndNestingLevel() < + Changes[ScopeStack.back()].indentAndNestingLevel()) ScopeStack.pop_back(); - if (i != Start && Changes[i].nestingAndIndentLevel() > - Changes[i - 1].nestingAndIndentLevel()) + if (i != Start && Changes[i].indentAndNestingLevel() > + Changes[i - 1].indentAndNestingLevel()) ScopeStack.push_back(i); bool InsideNestedScope = ScopeStack.size() != 0; @@ -327,8 +327,8 @@ static unsigned AlignTokens(const FormatStyle &Style, F &&Matches, // Measure the scope level (i.e. depth of (), [], {}) of the first token, and // abort when we hit any token in a higher scope than the starting one. - auto NestingAndIndentLevel = StartAt < Changes.size() - ? Changes[StartAt].nestingAndIndentLevel() + auto IndentAndNestingLevel = StartAt < Changes.size() + ? Changes[StartAt].indentAndNestingLevel() : std::pair<unsigned, unsigned>(0, 0); // Keep track of the number of commas before the matching tokens, we will only @@ -359,7 +359,7 @@ static unsigned AlignTokens(const FormatStyle &Style, F &&Matches, unsigned i = StartAt; for (unsigned e = Changes.size(); i != e; ++i) { - if (Changes[i].nestingAndIndentLevel() < NestingAndIndentLevel) + if (Changes[i].indentAndNestingLevel() < IndentAndNestingLevel) break; if (Changes[i].NewlinesBefore != 0) { @@ -375,7 +375,7 @@ static unsigned AlignTokens(const FormatStyle &Style, F &&Matches, if (Changes[i].Tok->is(tok::comma)) { ++CommasBeforeMatch; - } else if (Changes[i].nestingAndIndentLevel() > NestingAndIndentLevel) { + } else if (Changes[i].indentAndNestingLevel() > IndentAndNestingLevel) { // Call AlignTokens recursively, skipping over this scope block. unsigned StoppedAt = AlignTokens(Style, Matches, Changes, i); i = StoppedAt - 1; |
