|
clang 22.0.0git
|
#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/ContinuationIndenter.h"
Public Member Functions | |
| ContinuationIndenter (const FormatStyle &Style, const AdditionalKeywords &Keywords, const SourceManager &SourceMgr, WhitespaceManager &Whitespaces, encoding::Encoding Encoding, bool BinPackInconclusiveFunctions) | |
Constructs a ContinuationIndenter to format Line starting in column FirstIndent. | |
| LineState | getInitialState (unsigned FirstIndent, unsigned FirstStartColumn, const AnnotatedLine *Line, bool DryRun) |
| Get the initial state, i.e. | |
| bool | canBreak (const LineState &State) |
Returns true, if a line break after State is allowed. | |
| bool | mustBreak (const LineState &State) |
Returns true, if a line break after State is mandatory. | |
| unsigned | addTokenToState (LineState &State, bool Newline, bool DryRun, unsigned ExtraSpaces=0) |
Appends the next token to State and updates information necessary for indentation. | |
| unsigned | getColumnLimit (const LineState &State) const |
| Get the column limit for this line. | |
Definition at line 81 of file ContinuationIndenter.h.
| clang::format::ContinuationIndenter::ContinuationIndenter | ( | const FormatStyle & | Style, |
| const AdditionalKeywords & | Keywords, | ||
| const SourceManager & | SourceMgr, | ||
| WhitespaceManager & | Whitespaces, | ||
| encoding::Encoding | Encoding, | ||
| bool | BinPackInconclusiveFunctions ) |
Constructs a ContinuationIndenter to format Line starting in column FirstIndent.
Definition at line 282 of file ContinuationIndenter.cpp.
| unsigned clang::format::ContinuationIndenter::addTokenToState | ( | LineState & | State, |
| bool | Newline, | ||
| bool | DryRun, | ||
| unsigned | ExtraSpaces = 0 ) |
Appends the next token to State and updates information necessary for indentation.
Puts the token on the current line if Newline is false and adds a line break and necessary indentation otherwise.
If DryRun is false, also creates and stores the required Replacement.
Definition at line 712 of file ContinuationIndenter.cpp.
References clang::SourceRange::getBegin(), clang::SourceRange::getEnd(), clang::format::FormatToken::is(), clang::format::FormatToken::LastNewlineOffset, Previous, and clang::format::FormatToken::WhitespaceRange.
Returns true, if a line break after State is allowed.
Definition at line 337 of file ContinuationIndenter.cpp.
References clang::format::BK_BracedInit, clang::format::FormatToken::CanBreakBefore, clang::format::FormatToken::is(), clang::format::FormatToken::isNoneOf(), clang::format::FormatToken::isNot(), clang::format::FormatToken::MatchingParen, clang::format::FormatToken::MustBreakBefore, clang::format::FormatToken::NestingLevel, clang::format::FormatToken::Previous, and Previous.
Get the column limit for this line.
This is the style's column limit, potentially reduced for preprocessor definitions.
Definition at line 3025 of file ContinuationIndenter.cpp.
Referenced by mustBreak().
| LineState clang::format::ContinuationIndenter::getInitialState | ( | unsigned | FirstIndent, |
| unsigned | FirstStartColumn, | ||
| const AnnotatedLine * | Line, | ||
| bool | DryRun ) |
Get the initial state, i.e.
the state after placing Line's first token at FirstIndent. When reformatting a fragment of code, as in the case of formatting inside raw string literals, FirstStartColumn is the column at which the state of the parent formatter is.
Definition at line 293 of file ContinuationIndenter.cpp.
References clang::format::LineState::FirstIndent, clang::Line, clang::format::LT_ImportStatement, and clang::format::LT_PreprocessorDirective.
Returns true, if a line break after State is mandatory.
Definition at line 437 of file ContinuationIndenter.cpp.
References clang::prec::Assignment, clang::format::BK_Block, clang::format::FormatToken::CanBreakBefore, clang::prec::Equality, getColumnLimit(), clang::format::getLengthToMatchingParen(), clang::format::getLengthToNextOperator(), clang::format::FormatToken::is(), clang::format::FormatToken::isNoneOf(), clang::format::FormatToken::isNot(), clang::format::LT_PreprocessorDirective, clang::format::FormatToken::MatchingParen, clang::format::FormatToken::MustBreakBefore, clang::format::FormatToken::NestingLevel, clang::format::FormatToken::NewlinesBefore, clang::format::FormatToken::ObjCSelectorNameParts, clang::format::opensProtoMessageField(), clang::format::FormatToken::Previous, Previous, clang::prec::Relational, clang::prec::Spaceship, clang::format::startsNextParameter(), clang::format::startsSegmentOfBuilderTypeCall(), Tok, and clang::format::FormatToken::TokenText.