Lines Matching full:stack

78   State.Stack.push_back(ParenState(FirstIndent, Line->Level, FirstIndent,  in getInitialState()
97 !(State.Stack.back().BreakBeforeClosingBrace && in canBreak()
116 if (Current.isMemberAccess() && State.Stack.back().ContainsUnwrappedBuilder) in canBreak()
121 if (Previous.is(tok::l_brace) && State.Stack.size() > 1 && in canBreak()
122 State.Stack[State.Stack.size() - 2].NestedBlockInlined && in canBreak()
123 State.Stack[State.Stack.size() - 2].HasMultipleNestedBlocks) in canBreak()
133 return !State.Stack.back().NoLineBreak; in canBreak()
141 if (State.Stack.back().BreakBeforeClosingBrace && in mustBreak()
152 State.Stack.back().BreakBeforeParameter && !Current.isTrailingComment() && in mustBreak()
164 State.Stack.back().BreakBeforeParameter) && in mustBreak()
168 if (Current.is(TT_SelectorName) && State.Stack.back().ObjCSelectorNameFound && in mustBreak()
169 State.Stack.back().BreakBeforeParameter) in mustBreak()
205 State.Stack.back().BreakBeforeParameter) in mustBreak()
208 State.Stack.back().BreakBeforeParameter) { in mustBreak()
214 State.Stack.back().BreakBeforeParameter && in mustBreak()
215 State.Stack.back().FirstLessLess == 0) in mustBreak()
234 State.Stack.back().BreakBeforeParameter) in mustBreak()
238 (State.Stack.back().CallContinuation != 0 || in mustBreak()
239 State.Stack.back().BreakBeforeParameter)) in mustBreak()
261 assert(!State.Stack.empty()); in addTokenToState()
297 State.Stack.back().VariablePos == 0) { in addTokenOnCurrentLine()
298 State.Stack.back().VariablePos = State.Column; in addTokenOnCurrentLine()
301 while (Tok && State.Stack.back().VariablePos >= Tok->ColumnWidth) { in addTokenOnCurrentLine()
302 State.Stack.back().VariablePos -= Tok->ColumnWidth; in addTokenOnCurrentLine()
308 State.Stack.back().LastSpace = State.Stack.back().VariablePos; in addTokenOnCurrentLine()
318 !State.Stack.back().ObjCSelectorNameFound) { in addTokenOnCurrentLine()
320 State.Stack.back().AlignColons = false; in addTokenOnCurrentLine()
321 else if (State.Stack.back().Indent + Current.LongestObjCSelectorName > in addTokenOnCurrentLine()
323 State.Stack.back().ColonPos = in addTokenOnCurrentLine()
325 State.Stack.back().Indent) + in addTokenOnCurrentLine()
328 State.Stack.back().ColonPos = State.Column + Spaces + Current.ColumnWidth; in addTokenOnCurrentLine()
338 State.Stack.back().NoLineBreak = true; in addTokenOnCurrentLine()
343 State.Stack.back().Indent = State.Column + Spaces; in addTokenOnCurrentLine()
344 if (State.Stack.back().AvoidBinPacking && startsNextParameter(Current, Style)) in addTokenOnCurrentLine()
345 State.Stack.back().NoLineBreak = true; in addTokenOnCurrentLine()
348 State.Stack.back().ContainsUnwrappedBuilder = true; in addTokenOnCurrentLine()
351 State.Stack.back().NoLineBreak = true; in addTokenOnCurrentLine()
361 State.Stack.back().NoLineBreak = true; in addTokenOnCurrentLine()
370 State.Stack.back().LastSpace = State.Column; in addTokenOnCurrentLine()
371 State.Stack.back().NestedBlockIndent = State.Column; in addTokenOnCurrentLine()
375 State.Stack.back().LastSpace = State.Column; in addTokenOnCurrentLine()
385 State.Stack.back().LastSpace = State.Column; in addTokenOnCurrentLine()
387 State.Stack.back().Indent = State.Column; in addTokenOnCurrentLine()
388 State.Stack.back().LastSpace = State.Column; in addTokenOnCurrentLine()
400 if (HasTrailingCall && State.Stack.size() > 1 && in addTokenOnCurrentLine()
401 State.Stack[State.Stack.size() - 2].CallContinuation == 0) in addTokenOnCurrentLine()
402 State.Stack.back().LastSpace = State.Column; in addTokenOnCurrentLine()
421 if (!State.Stack.back().ContainsLineBreak) in addTokenOnNewLine()
423 State.Stack.back().ContainsLineBreak = true; in addTokenOnNewLine()
431 State.Stack.back().FirstLessLess == 0 && in addTokenOnNewLine()
433 State.Stack.back().BreakBeforeParameter)) in addTokenOnNewLine()
450 State.Stack.back().NestedBlockIndent = State.Column; in addTokenOnNewLine()
453 if (State.Stack.back().CallContinuation == 0) in addTokenOnNewLine()
454 State.Stack.back().CallContinuation = State.Column; in addTokenOnNewLine()
456 if (!State.Stack.back().ObjCSelectorNameFound) { in addTokenOnNewLine()
458 State.Stack.back().AlignColons = false; in addTokenOnNewLine()
460 State.Stack.back().ColonPos = in addTokenOnNewLine()
462 ? std::max(State.Stack.back().Indent, in addTokenOnNewLine()
464 : State.Stack.back().Indent) + in addTokenOnNewLine()
467 } else if (State.Stack.back().AlignColons && in addTokenOnNewLine()
468 State.Stack.back().ColonPos <= NextNonComment->ColumnWidth) { in addTokenOnNewLine()
469 State.Stack.back().ColonPos = State.Column + NextNonComment->ColumnWidth; in addTokenOnNewLine()
482 if (State.Stack.size() > 1) in addTokenOnNewLine()
483 State.Stack[State.Stack.size() - 2].LastSpace = in addTokenOnNewLine()
484 std::max(State.Stack.back().LastSpace, State.Stack.back().Indent) + in addTokenOnNewLine()
489 !State.Stack.back().AvoidBinPacking) || in addTokenOnNewLine()
491 State.Stack.back().BreakBeforeParameter = false; in addTokenOnNewLine()
494 State.Stack.back().BreakBeforeParameter = false; in addTokenOnNewLine()
497 State.Stack.back().BreakBeforeParameter = true; in addTokenOnNewLine()
499 State.Stack.back().BreakBeforeParameter = false; in addTokenOnNewLine()
505 State.Stack.back().IndentLevel, State.Column, in addTokenOnNewLine()
510 State.Stack.back().LastSpace = State.Column; in addTokenOnNewLine()
518 Current.is(tok::r_brace) && State.Stack.size() > 1 && in addTokenOnNewLine()
519 State.Stack[State.Stack.size() - 2].NestedBlockInlined; in addTokenOnNewLine()
521 for (unsigned i = 0, e = State.Stack.size() - 1; i != e; ++i) in addTokenOnNewLine()
522 State.Stack[i].BreakBeforeParameter = true; in addTokenOnNewLine()
532 State.Stack.back().BreakBeforeParameter = true; in addTokenOnNewLine()
538 State.Stack.back().BreakBeforeClosingBrace = true; in addTokenOnNewLine()
540 if (State.Stack.back().AvoidBinPacking) { in addTokenOnNewLine()
548 State.Stack.back().BreakBeforeParameter = true; in addTokenOnNewLine()
561 std::max(State.Stack.back().LastSpace, State.Stack.back().Indent) + in getNewLineColumn()
571 return std::max(State.Stack.back().LastSpace, in getNewLineColumn()
572 State.Stack.back().Indent + Style.ContinuationIndentWidth); in getNewLineColumn()
576 : State.Stack.back().Indent; in getNewLineColumn()
577 if (Current.isOneOf(tok::r_brace, tok::r_square) && State.Stack.size() > 1) { in getNewLineColumn()
579 return State.Stack[State.Stack.size() - 2].NestedBlockIndent; in getNewLineColumn()
582 return State.Stack[State.Stack.size() - 2].LastSpace; in getNewLineColumn()
587 return State.Stack.back().Indent; in getNewLineColumn()
594 State.Stack.back().FirstLessLess != 0) in getNewLineColumn()
595 return State.Stack.back().FirstLessLess; in getNewLineColumn()
597 if (State.Stack.back().CallContinuation == 0) in getNewLineColumn()
599 return State.Stack.back().CallContinuation; in getNewLineColumn()
601 if (State.Stack.back().QuestionColumn != 0 && in getNewLineColumn()
605 return State.Stack.back().QuestionColumn; in getNewLineColumn()
606 if (Previous.is(tok::comma) && State.Stack.back().VariablePos != 0) in getNewLineColumn()
607 return State.Stack.back().VariablePos; in getNewLineColumn()
615 return std::max(State.Stack.back().LastSpace, State.Stack.back().Indent); in getNewLineColumn()
617 if (!State.Stack.back().ObjCSelectorNameFound) { in getNewLineColumn()
619 return State.Stack.back().Indent; in getNewLineColumn()
621 ? std::max(State.Stack.back().Indent, in getNewLineColumn()
623 : State.Stack.back().Indent) + in getNewLineColumn()
627 if (!State.Stack.back().AlignColons) in getNewLineColumn()
628 return State.Stack.back().Indent; in getNewLineColumn()
629 if (State.Stack.back().ColonPos > NextNonComment->ColumnWidth) in getNewLineColumn()
630 return State.Stack.back().ColonPos - NextNonComment->ColumnWidth; in getNewLineColumn()
631 return State.Stack.back().Indent; in getNewLineColumn()
634 if (State.Stack.back().StartOfArraySubscripts != 0) in getNewLineColumn()
635 return State.Stack.back().StartOfArraySubscripts; in getNewLineColumn()
643 return State.Stack.back().Indent; in getNewLineColumn()
654 return State.Stack.back().Indent; in getNewLineColumn()
658 if (State.Stack.back().Indent == State.FirstIndent && PreviousNonComment && in getNewLineColumn()
662 return State.Stack.back().Indent + Style.ContinuationIndentWidth; in getNewLineColumn()
663 return State.Stack.back().Indent; in getNewLineColumn()
668 assert(State.Stack.size()); in moveStateToNextToken()
672 State.Stack.back().AvoidBinPacking = true; in moveStateToNextToken()
674 if (State.Stack.back().FirstLessLess == 0) in moveStateToNextToken()
675 State.Stack.back().FirstLessLess = State.Column; in moveStateToNextToken()
677 State.Stack.back().LastOperatorWrapped = Newline; in moveStateToNextToken()
681 State.Stack.back().LastOperatorWrapped = Newline; in moveStateToNextToken()
683 State.Stack.back().StartOfArraySubscripts == 0) in moveStateToNextToken()
684 State.Stack.back().StartOfArraySubscripts = State.Column; in moveStateToNextToken()
689 State.Stack.back().QuestionColumn = State.Column; in moveStateToNextToken()
694 State.Stack.back().StartOfFunctionCall = in moveStateToNextToken()
697 State.Stack.back().ObjCSelectorNameFound = true; in moveStateToNextToken()
699 State.Stack.back().Indent = in moveStateToNextToken()
709 State.Stack.back().Indent = in moveStateToNextToken()
711 State.Stack.back().NestedBlockIndent = State.Stack.back().Indent; in moveStateToNextToken()
713 State.Stack.back().AvoidBinPacking = true; in moveStateToNextToken()
714 State.Stack.back().BreakBeforeParameter = false; in moveStateToNextToken()
717 State.Stack.back().NestedBlockIndent = in moveStateToNextToken()
731 State.Stack.size() > 1) { in moveStateToNextToken()
732 if (State.Stack[State.Stack.size() - 2].NestedBlockInlined && Newline) in moveStateToNextToken()
733 for (unsigned i = 0, e = State.Stack.size() - 1; i != e; ++i) in moveStateToNextToken()
734 State.Stack[i].NoLineBreak = true; in moveStateToNextToken()
735 State.Stack[State.Stack.size() - 2].NestedBlockInlined = false; in moveStateToNextToken()
740 State.Stack.back().NestedBlockInlined = in moveStateToNextToken()
797 ParenState NewParenState = State.Stack.back(); in moveStatePastFakeLParens()
811 State.Stack.back().LastSpace); in moveStatePastFakeLParens()
827 (!State.Stack.back().LastOperatorWrapped && BreakBeforeOperator)) in moveStatePastFakeLParens()
852 State.Stack.push_back(NewParenState); in moveStatePastFakeLParens()
859 unsigned VariablePos = State.Stack.back().VariablePos; in moveStatePastFakeRParens()
860 if (State.Stack.size() == 1) { in moveStatePastFakeRParens()
864 State.Stack.pop_back(); in moveStatePastFakeRParens()
865 State.Stack.back().VariablePos = VariablePos; in moveStatePastFakeRParens()
881 unsigned NewIndentLevel = State.Stack.back().IndentLevel; in moveStatePastScopeOpener()
882 unsigned LastSpace = State.Stack.back().LastSpace; in moveStatePastScopeOpener()
885 unsigned NestedBlockIndent = std::max(State.Stack.back().StartOfFunctionCall, in moveStatePastScopeOpener()
886 State.Stack.back().NestedBlockIndent); in moveStatePastScopeOpener()
889 NewIndent = State.Stack.back().NestedBlockIndent + Style.IndentWidth; in moveStatePastScopeOpener()
893 NewIndent = State.Stack.back().LastSpace + Style.ContinuationIndentWidth; in moveStatePastScopeOpener()
904 std::max(State.Stack.back().LastSpace, in moveStatePastScopeOpener()
905 State.Stack.back().StartOfFunctionCall); in moveStatePastScopeOpener()
914 NewIndent = std::max(NewIndent, State.Stack.back().Indent); in moveStatePastScopeOpener()
915 LastSpace = std::max(LastSpace, State.Stack.back().Indent); in moveStatePastScopeOpener()
952 (State.Stack.back().NoLineBreak || in moveStatePastScopeOpener()
954 State.Stack.back().ContainsUnwrappedBuilder)); in moveStatePastScopeOpener()
955 State.Stack.push_back(ParenState(NewIndent, NewIndentLevel, LastSpace, in moveStatePastScopeOpener()
957 State.Stack.back().NestedBlockIndent = NestedBlockIndent; in moveStatePastScopeOpener()
958 State.Stack.back().BreakBeforeParameter = BreakBeforeParameter; in moveStatePastScopeOpener()
959 State.Stack.back().HasMultipleNestedBlocks = Current.BlockParameterCount > 1; in moveStatePastScopeOpener()
969 if (State.Stack.size() > 1 && in moveStatePastScopeCloser()
973 State.Stack.pop_back(); in moveStatePastScopeCloser()
979 State.Stack.back().StartOfArraySubscripts = 0; in moveStatePastScopeCloser()
984 unsigned NestedBlockIndent = State.Stack.back().NestedBlockIndent; in moveStateToNewBlock()
990 State.Stack.push_back(ParenState( in moveStateToNewBlock()
991 NewIndent, /*NewIndentLevel=*/State.Stack.back().IndentLevel + 1, in moveStateToNewBlock()
992 State.Stack.back().LastSpace, /*AvoidBinPacking=*/true, in moveStateToNewBlock()
994 State.Stack.back().NestedBlockIndent = NestedBlockIndent; in moveStateToNewBlock()
995 State.Stack.back().BreakBeforeParameter = true; in moveStateToNewBlock()
1001 for (unsigned i = 0, e = State.Stack.size(); i != e; ++i) in addMultilineToken()
1002 State.Stack[i].BreakBeforeParameter = true; in addMultilineToken()
1163 for (unsigned i = 0, e = State.Stack.size(); i != e; ++i) in breakProtrudingToken()
1164 State.Stack[i].BreakBeforeParameter = true; in breakProtrudingToken()
1170 State.Stack.back().LastSpace = StartColumn; in breakProtrudingToken()