clang API Documentation
#include <FormatToken.h>
Classes | |
struct | ColumnFormat |
A struct that holds information on how to format a given list with a specific number of columns. | |
Public Member Functions | |
CommaSeparatedList (const FormatStyle &Style) | |
void | precomputeFormattingInfos (const FormatToken *Token) override |
After the TokenAnnotator has finished annotating all the tokens, this function precomputes required information for formatting. | |
unsigned | formatAfterToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun) override |
Same as formatFromToken , but assumes that the first token has already been set thereby deciding on the first line break. | |
unsigned | formatFromToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun) override |
Apply the special formatting that the given role demands. | |
void | CommaFound (const FormatToken *Token) override |
Adds Token as the next comma to the CommaSeparated list. |
Definition at line 483 of file FormatToken.h.
clang::format::CommaSeparatedList::CommaSeparatedList | ( | const FormatStyle & | Style | ) | [inline] |
Definition at line 485 of file FormatToken.h.
void clang::format::CommaSeparatedList::CommaFound | ( | const FormatToken * | Token | ) | [inline, override, virtual] |
Adds Token
as the next comma to the CommaSeparated
list.
Reimplemented from clang::format::TokenRole.
Definition at line 497 of file FormatToken.h.
unsigned clang::format::CommaSeparatedList::formatAfterToken | ( | LineState & | State, |
ContinuationIndenter * | Indenter, | ||
bool | DryRun | ||
) | [override, virtual] |
Same as formatFromToken
, but assumes that the first token has already been set thereby deciding on the first line break.
Reimplemented from clang::format::TokenRole.
Definition at line 59 of file FormatToken.cpp.
References clang::format::ContinuationIndenter::addTokenToState(), clang::format::BK_Block, clang::format::FormatToken::BlockKind, clang::format::LineState::Column, Column, clang::format::FormatStyle::ColumnLimit, clang::format::FormatToken::ColumnWidth, clang::format::FormatToken::isNot(), clang::format::FormatToken::isTrailingComment(), clang::format::FormatToken::MatchingParen, clang::format::FormatToken::MustBreakBefore, NewLine, clang::format::FormatToken::Next, clang::format::LineState::NextToken, clang::format::FormatToken::Previous, clang::format::TokenRole::Style, clang::format::TT_DesignatedInitializerPeriod, clang::format::TT_DictLiteral, and clang::format::FormatToken::Type.
unsigned clang::format::CommaSeparatedList::formatFromToken | ( | LineState & | State, |
ContinuationIndenter * | Indenter, | ||
bool | DryRun | ||
) | [override, virtual] |
Apply the special formatting that the given role demands.
Assumes that the token having this role is already formatted.
Continues formatting from State
leaving indentation to Indenter
and returns the total penalty that this formatting incurs.
Reimplemented from clang::format::TokenRole.
Definition at line 113 of file FormatToken.cpp.
References clang::format::LineState::Stack.
void clang::format::CommaSeparatedList::precomputeFormattingInfos | ( | const FormatToken * | Token | ) | [override, virtual] |
After the TokenAnnotator
has finished annotating all the tokens, this function precomputes required information for formatting.
Reimplemented from clang::format::TokenRole.
Definition at line 129 of file FormatToken.cpp.
References clang::format::FormatStyle::BinPackParameters, clang::format::FormatToken::CanBreakBefore, clang::format::CodePointsBetween(), Column, clang::format::FormatStyle::ColumnLimit, clang::format::FormatStyle::Cpp11BracedListStyle, clang::format::FormatToken::getNextNonComment(), clang::format::FormatToken::getPreviousNonComment(), clang::format::FormatToken::HasUnescapedNewline, clang::format::FormatToken::is(), clang::format::FormatToken::isNot(), clang::format::FormatToken::isTrailingComment(), clang::format::FormatToken::MatchingParen, clang::format::FormatToken::MustBreakBefore, clang::format::FormatToken::NestingLevel, clang::format::FormatToken::Next, clang::format::FormatToken::Previous, and clang::format::TokenRole::Style.