clang
6.0.0
|
The current state when indenting a unwrapped line. More...
#include "/work/www-prereleases/6.0.0/rc3/llvm.src/tools/clang/lib/Format/ContinuationIndenter.h"
Public Member Functions | |
bool | operator< (const LineState &Other) const |
Comparison operator to be able to used LineState in map . More... | |
Public Attributes | |
unsigned | Column |
The number of used columns in the current line. More... | |
FormatToken * | NextToken |
The token that needs to be next formatted. More... | |
bool | LineContainsContinuedForLoopSection |
true if this line contains a continued for-loop section. More... | |
bool | NoContinuation |
true if NextToken should not continue this line. More... | |
unsigned | StartOfLineLevel |
The NestingLevel at the start of this line. More... | |
unsigned | LowestLevelOnLine |
The lowest NestingLevel on the current line. More... | |
unsigned | StartOfStringLiteral |
The start column of the string literal, if we're in a string literal sequence, 0 otherwise. More... | |
std::vector< ParenState > | Stack |
A stack keeping track of properties applying to parenthesis levels. More... | |
bool | IgnoreStackForComparison |
Ignore the stack of ParenStates for state comparison. More... | |
unsigned | FirstIndent |
The indent of the first token. More... | |
const AnnotatedLine * | Line |
The line that is being formatted. More... | |
The current state when indenting a unwrapped line.
As the indenting tries different combinations this is copied by value.
Definition at line 361 of file ContinuationIndenter.h.
Comparison operator to be able to used LineState
in map
.
Definition at line 412 of file ContinuationIndenter.h.
References Column, IgnoreStackForComparison, LineContainsContinuedForLoopSection, LowestLevelOnLine, NextToken, NoContinuation, Stack, StartOfLineLevel, and StartOfStringLiteral.
unsigned clang::format::LineState::Column |
The number of used columns in the current line.
Definition at line 363 of file ContinuationIndenter.h.
Referenced by clang::format::CommaSeparatedList::formatAfterToken(), clang::format::ContinuationIndenter::getColumnLimit(), clang::format::ContinuationIndenter::getInitialState(), and operator<().
unsigned clang::format::LineState::FirstIndent |
The indent of the first token.
Definition at line 404 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState().
bool clang::format::LineState::IgnoreStackForComparison |
Ignore the stack of ParenStates
for state comparison.
In long and deeply nested unwrapped lines, the current algorithm can be insufficient for finding the best formatting with a reasonable amount of time and memory. Setting this flag will effectively lead to the algorithm not analyzing some combinations. However, these combinations rarely contain the optimal solution: In short, accepting a higher penalty early would need to lead to different values in the ParenState
stack (in an otherwise identical state) and these different values would need to lead to a significant amount of avoided penalty later.
FIXME: Come up with a better algorithm instead.
Definition at line 401 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().
const AnnotatedLine* clang::format::LineState::Line |
The line that is being formatted.
Does not need to be considered for memoization because it doesn't change.
Definition at line 409 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getColumnLimit(), and clang::format::ContinuationIndenter::getInitialState().
bool clang::format::LineState::LineContainsContinuedForLoopSection |
true
if this line contains a continued for-loop section.
Definition at line 369 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().
unsigned clang::format::LineState::LowestLevelOnLine |
The lowest NestingLevel
on the current line.
Definition at line 378 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().
FormatToken* clang::format::LineState::NextToken |
The token that needs to be next formatted.
Definition at line 366 of file ContinuationIndenter.h.
Referenced by clang::format::CommaSeparatedList::formatAfterToken(), clang::format::ContinuationIndenter::getColumnLimit(), clang::format::ContinuationIndenter::getInitialState(), operator<(), and clang::format::BreakableLineCommentSection::updateNextToken().
bool clang::format::LineState::NoContinuation |
true
if NextToken
should not continue this line.
Definition at line 372 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().
std::vector<ParenState> clang::format::LineState::Stack |
A stack keeping track of properties applying to parenthesis levels.
Definition at line 386 of file ContinuationIndenter.h.
Referenced by clang::format::CommaSeparatedList::formatFromToken(), clang::format::ContinuationIndenter::getInitialState(), and operator<().
unsigned clang::format::LineState::StartOfLineLevel |
The NestingLevel
at the start of this line.
Definition at line 375 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().
unsigned clang::format::LineState::StartOfStringLiteral |
The start column of the string literal, if we're in a string literal sequence, 0 otherwise.
Definition at line 382 of file ContinuationIndenter.h.
Referenced by clang::format::ContinuationIndenter::getInitialState(), and operator<().