clang 22.0.0git
clang::CommaSeparatedList Class Reference

#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/FormatToken.h"

Inheritance diagram for clang::CommaSeparatedList:
[legend]

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.
const FormatTokenlastComma () override
Public Member Functions inherited from clang::TokenRole
 TokenRole (const FormatStyle &Style)
virtual ~TokenRole ()

Additional Inherited Members

Protected Attributes inherited from clang::TokenRole
const FormatStyle & Style

Detailed Description

Definition at line 966 of file FormatToken.h.

Constructor & Destructor Documentation

◆ CommaSeparatedList()

clang::CommaSeparatedList::CommaSeparatedList ( const FormatStyle & Style)
inline

Definition at line 968 of file FormatToken.h.

References clang::TokenRole::Style.

Member Function Documentation

◆ CommaFound()

void clang::CommaSeparatedList::CommaFound ( const FormatToken * Token)
inlineoverridevirtual

Adds Token as the next comma to the CommaSeparated list.

Reimplemented from clang::TokenRole.

Definition at line 980 of file FormatToken.h.

Referenced by lastComma().

◆ formatAfterToken()

unsigned clang::format::CommaSeparatedList::formatAfterToken ( LineState & State,
ContinuationIndenter * Indenter,
bool DryRun )
overridevirtual

Same as formatFromToken, but assumes that the first token has already been set thereby deciding on the first line break.

Reimplemented from clang::TokenRole.

Definition at line 86 of file FormatToken.cpp.

References clang::format::BK_Block, clang::Column, FormatToken(), and clang::TokenRole::Style.

◆ formatFromToken()

unsigned clang::format::CommaSeparatedList::formatFromToken ( LineState & State,
ContinuationIndenter * Indenter,
bool DryRun )
overridevirtual

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::TokenRole.

Definition at line 146 of file FormatToken.cpp.

◆ lastComma()

const FormatToken * clang::CommaSeparatedList::lastComma ( )
inlineoverridevirtual

Reimplemented from clang::TokenRole.

Definition at line 984 of file FormatToken.h.

References CommaFound(), and FormatToken().

◆ precomputeFormattingInfos()

void clang::format::CommaSeparatedList::precomputeFormattingInfos ( const FormatToken * Token)
overridevirtual

After the TokenAnnotator has finished annotating all the tokens, this function precomputes required information for formatting.

Reimplemented from clang::TokenRole.

Definition at line 164 of file FormatToken.cpp.

References clang::format::CodePointsBetween(), clang::Column, FormatToken(), clang::Token::is(), clang::Token::isOneOf(), clang::TokenRole::Style, and UINT_MAX.


The documentation for this class was generated from the following files: