clang 19.0.0git
Classes | Public Member Functions | List of all members
clang::format::CommaSeparatedList Class Reference

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

Inheritance diagram for clang::format::CommaSeparatedList:
Inheritance graph
[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::format::TokenRole
 TokenRole (const FormatStyle &Style)
 
virtual ~TokenRole ()
 
virtual void precomputeFormattingInfos (const FormatToken *Token)
 After the TokenAnnotator has finished annotating all the tokens, this function precomputes required information for formatting.
 
virtual unsigned formatFromToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun)
 Apply the special formatting that the given role demands.
 
virtual unsigned formatAfterToken (LineState &State, ContinuationIndenter *Indenter, bool DryRun)
 Same as formatFromToken, but assumes that the first token has already been set thereby deciding on the first line break.
 
virtual void CommaFound (const FormatToken *Token)
 Notifies the Role that a comma was found.
 
virtual const FormatTokenlastComma ()
 

Additional Inherited Members

- Protected Attributes inherited from clang::format::TokenRole
const FormatStyleStyle
 

Detailed Description

Definition at line 931 of file FormatToken.h.

Constructor & Destructor Documentation

◆ CommaSeparatedList()

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

Definition at line 933 of file FormatToken.h.

Member Function Documentation

◆ CommaFound()

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

Adds Token as the next comma to the CommaSeparated list.

Reimplemented from clang::format::TokenRole.

Definition at line 945 of file FormatToken.h.

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

Definition at line 124 of file FormatToken.cpp.

References clang::format::BK_Block, clang::Column, clang::format::FormatStyle::ColumnLimit, Indenter, clang::format::FormatToken::is(), clang::format::FormatToken::isOneOf(), clang::format::FormatToken::MatchingParen, NewLine, clang::format::FormatToken::Next, and clang::format::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::format::TokenRole.

Definition at line 184 of file FormatToken.cpp.

◆ lastComma()

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

Reimplemented from clang::format::TokenRole.

Definition at line 949 of file FormatToken.h.

◆ precomputeFormattingInfos()

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

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