clang 20.0.0git
|
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/Format/TokenAnnotator.h"
Public Member Functions | |
AnnotatedLine (const UnwrappedLine &Line) | |
void | addChildren (const UnwrappedLineNode &Node, FormatToken *Current) |
size_t | size () const |
~AnnotatedLine () | |
bool | isComment () const |
template<typename... Ts> | |
bool | startsWith (Ts... Tokens) const |
true if this line starts with the given tokens in order, ignoring comments. | |
template<typename... Ts> | |
bool | endsWith (Ts... Tokens) const |
true if this line ends with the given tokens in reversed order, ignoring comments. | |
bool | mightBeFunctionDefinition () const |
true if this line looks like a function definition instead of a function declaration. | |
bool | startsWithNamespace () const |
true if this line starts a namespace definition. | |
FormatToken * | getFirstNonComment () const |
FormatToken * | getLastNonComment () const |
Public Attributes | |
FormatToken * | First |
FormatToken * | Last |
SmallVector< AnnotatedLine *, 0 > | Children |
LineType | Type |
unsigned | Level |
unsigned | PPLevel |
size_t | MatchingOpeningBlockLineIndex |
size_t | MatchingClosingBlockLineIndex |
bool | InPPDirective |
bool | InPragmaDirective |
bool | InMacroBody |
bool | MustBeDeclaration |
bool | MightBeFunctionDecl |
bool | IsMultiVariableDeclStmt |
bool | ContainsMacroCall = false |
True if this line contains a macro call for which an expansion exists. | |
bool | Computed = false |
True if calculateFormattingInformation() has been called on this line. | |
bool | Affected |
True if this line should be formatted, i.e. | |
bool | LeadingEmptyLinesAffected |
True if the leading empty lines of this line intersect with one of the input ranges. | |
bool | ChildrenAffected |
True if one of this line's children intersects with an input range. | |
bool | ReturnTypeWrapped |
True if breaking after last attribute group in function return type. | |
bool | IsContinuation |
True if this line should be indented by ContinuationIndent in addition to the normal indention level. | |
unsigned | FirstStartColumn |
Definition at line 47 of file TokenAnnotator.h.
|
inline |
Definition at line 49 of file TokenAnnotator.h.
References addChildren(), ContainsMacroCall, First, Last, clang::Line, clang::format::FormatToken::Next, Node, and clang::format::FormatToken::Previous.
|
inline |
Definition at line 102 of file TokenAnnotator.h.
|
inline |
Definition at line 85 of file TokenAnnotator.h.
References Children, ContainsMacroCall, and Node.
Referenced by AnnotatedLine().
|
inline |
true
if this line ends with the given tokens in reversed order, ignoring comments.
For example, given tokens [T1, T2, T3, ...], the function returns true if this line is like "... T3 T2 T1".
Definition at line 127 of file TokenAnnotator.h.
References clang::format::FormatToken::endsSequence(), and Last.
Referenced by mightBeFunctionDefinition().
|
inline |
Definition at line 155 of file TokenAnnotator.h.
References First, clang::format::FormatToken::getNextNonComment(), and clang::format::FormatToken::is().
|
inline |
Definition at line 160 of file TokenAnnotator.h.
References clang::format::FormatToken::getPreviousNonComment(), clang::format::FormatToken::is(), and Last.
|
inline |
Definition at line 113 of file TokenAnnotator.h.
References First, clang::format::FormatToken::getNextNonComment(), and clang::format::FormatToken::is().
|
inline |
true
if this line looks like a function definition instead of a function declaration.
Asserts MightBeFunctionDecl.
Definition at line 133 of file TokenAnnotator.h.
References endsWith(), and MightBeFunctionDecl.
|
inline |
Definition at line 95 of file TokenAnnotator.h.
References Children.
|
inline |
true
if this line starts with the given tokens in order, ignoring comments.
Definition at line 119 of file TokenAnnotator.h.
References First, and clang::format::FormatToken::startsSequence().
Referenced by clang::format::computeNewlines(), clang::format::UnwrappedLineFormatter::format(), and startsWithNamespace().
|
inline |
true
if this line starts a namespace definition.
Definition at line 149 of file TokenAnnotator.h.
References startsWith().
Referenced by clang::format::computeNewlines().
bool clang::format::AnnotatedLine::Affected |
True
if this line should be formatted, i.e.
intersects directly or indirectly with one of the input ranges.
Definition at line 190 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format().
SmallVector<AnnotatedLine *, 0> clang::format::AnnotatedLine::Children |
Definition at line 168 of file TokenAnnotator.h.
Referenced by addChildren(), size(), and ~AnnotatedLine().
bool clang::format::AnnotatedLine::ChildrenAffected |
True
if one of this line's children intersects with an input range.
Definition at line 197 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format().
True
if calculateFormattingInformation() has been called on this line.
Definition at line 186 of file TokenAnnotator.h.
True
if this line contains a macro call for which an expansion exists.
Definition at line 183 of file TokenAnnotator.h.
Referenced by addChildren(), AnnotatedLine(), and clang::format::UnwrappedLineFormatter::format().
FormatToken* clang::format::AnnotatedLine::First |
Definition at line 165 of file TokenAnnotator.h.
Referenced by clang::format::NamespaceEndCommentsFixer::analyze(), clang::format::JavaScriptImportSorter::analyze(), AnnotatedLine(), clang::format::computeNewlines(), clang::format::UnwrappedLineFormatter::format(), getFirstNonComment(), isComment(), clang::format::TokenAnnotator::setCommentLineLevels(), startsWith(), and ~AnnotatedLine().
unsigned clang::format::AnnotatedLine::FirstStartColumn |
Definition at line 206 of file TokenAnnotator.h.
bool clang::format::AnnotatedLine::InMacroBody |
Definition at line 177 of file TokenAnnotator.h.
bool clang::format::AnnotatedLine::InPPDirective |
Definition at line 175 of file TokenAnnotator.h.
Referenced by clang::format::computeNewlines(), and clang::format::UnwrappedLineFormatter::format().
bool clang::format::AnnotatedLine::InPragmaDirective |
Definition at line 176 of file TokenAnnotator.h.
bool clang::format::AnnotatedLine::IsContinuation |
True
if this line should be indented by ContinuationIndent in addition to the normal indention level.
Definition at line 204 of file TokenAnnotator.h.
bool clang::format::AnnotatedLine::IsMultiVariableDeclStmt |
Definition at line 180 of file TokenAnnotator.h.
FormatToken* clang::format::AnnotatedLine::Last |
Definition at line 166 of file TokenAnnotator.h.
Referenced by AnnotatedLine(), clang::format::computeNewlines(), endsWith(), clang::format::UnwrappedLineFormatter::format(), and getLastNonComment().
bool clang::format::AnnotatedLine::LeadingEmptyLinesAffected |
True
if the leading empty lines of this line intersect with one of the input ranges.
Definition at line 194 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format().
unsigned clang::format::AnnotatedLine::Level |
Definition at line 171 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format(), and clang::format::TokenAnnotator::setCommentLineLevels().
size_t clang::format::AnnotatedLine::MatchingClosingBlockLineIndex |
Definition at line 174 of file TokenAnnotator.h.
size_t clang::format::AnnotatedLine::MatchingOpeningBlockLineIndex |
Definition at line 173 of file TokenAnnotator.h.
Referenced by clang::format::NamespaceEndCommentsFixer::analyze().
bool clang::format::AnnotatedLine::MightBeFunctionDecl |
Definition at line 179 of file TokenAnnotator.h.
Referenced by mightBeFunctionDefinition().
bool clang::format::AnnotatedLine::MustBeDeclaration |
Definition at line 178 of file TokenAnnotator.h.
unsigned clang::format::AnnotatedLine::PPLevel |
Definition at line 172 of file TokenAnnotator.h.
bool clang::format::AnnotatedLine::ReturnTypeWrapped |
True
if breaking after last attribute group in function return type.
Definition at line 200 of file TokenAnnotator.h.
LineType clang::format::AnnotatedLine::Type |
Definition at line 170 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format(), and clang::format::TokenAnnotator::setCommentLineLevels().