clang
3.9.0
|
#include <TokenAnnotator.h>
Public Member Functions | |
AnnotatedLine (const UnwrappedLine &Line) | |
~AnnotatedLine () | |
template<typename... Ts> | |
bool | startsWith (Ts...Tokens) const |
true if this line starts with the given tokens in order, ignoring comments. More... | |
template<typename... Ts> | |
bool | endsWith (Ts...Tokens) const |
true if this line ends with the given tokens in reversed order, ignoring comments. More... | |
bool | mightBeFunctionDefinition () const |
true if this line looks like a function definition instead of a function declaration. More... | |
Public Attributes | |
FormatToken * | First |
FormatToken * | Last |
SmallVector< AnnotatedLine *, 0 > | Children |
LineType | Type |
unsigned | Level |
bool | InPPDirective |
bool | MustBeDeclaration |
bool | MightBeFunctionDecl |
bool | IsMultiVariableDeclStmt |
bool | Affected |
True if this line should be formatted, i.e. More... | |
bool | LeadingEmptyLinesAffected |
True if the leading empty lines of this line intersect with one of the input ranges. More... | |
bool | ChildrenAffected |
True if a one of this line's children intersects with an input range. More... | |
Definition at line 39 of file TokenAnnotator.h.
|
inline |
Definition at line 41 of file TokenAnnotator.h.
References Children, clang::format::UnwrappedLineNode::Children, clang::format::FormatToken::Children, Current, E, First, I, Last, clang::format::FormatToken::Next, Node, clang::format::FormatToken::Previous, and clang::format::UnwrappedLine::Tokens.
|
inline |
Definition at line 71 of file TokenAnnotator.h.
References Children, clang::format::FormatToken::Children, Current, First, clang::format::FormatToken::Next, and clang::format::FormatToken::Role.
|
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 93 of file TokenAnnotator.h.
References clang::format::FormatToken::endsSequence(), Last, and Tokens.
|
inline |
true
if this line looks like a function definition instead of a function declaration.
Asserts MightBeFunctionDecl.
Definition at line 99 of file TokenAnnotator.h.
References clang::format::FormatToken::isOneOf(), Last, and MightBeFunctionDecl.
|
inline |
true
if this line starts with the given tokens in order, ignoring comments.
Definition at line 85 of file TokenAnnotator.h.
References First, clang::format::FormatToken::startsSequence(), and Tokens.
Referenced by clang::format::TokenAnnotator::annotate(), and clang::format::UnwrappedLineFormatter::format().
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 120 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format().
SmallVector<AnnotatedLine *, 0> clang::format::AnnotatedLine::Children |
Definition at line 109 of file TokenAnnotator.h.
Referenced by clang::format::TokenAnnotator::annotate(), AnnotatedLine(), clang::format::TokenAnnotator::calculateFormattingInformation(), and ~AnnotatedLine().
bool clang::format::AnnotatedLine::ChildrenAffected |
True
if a one of this line's children intersects with an input range.
Definition at line 127 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format().
FormatToken* clang::format::AnnotatedLine::First |
Definition at line 106 of file TokenAnnotator.h.
Referenced by clang::format::JavaScriptImportSorter::analyze(), clang::format::TokenAnnotator::annotate(), AnnotatedLine(), clang::format::TokenAnnotator::calculateFormattingInformation(), clang::format::AffectedRangeManager::computeAffectedLines(), clang::format::UnwrappedLineFormatter::format(), clang::format::ContinuationIndenter::getInitialState(), clang::format::TokenAnnotator::setCommentLineLevels(), startsWith(), and ~AnnotatedLine().
bool clang::format::AnnotatedLine::InPPDirective |
Definition at line 113 of file TokenAnnotator.h.
Referenced by clang::format::AffectedRangeManager::computeAffectedLines(), clang::format::UnwrappedLineFormatter::format(), and clang::format::ContinuationIndenter::getColumnLimit().
bool clang::format::AnnotatedLine::IsMultiVariableDeclStmt |
Definition at line 116 of file TokenAnnotator.h.
FormatToken* clang::format::AnnotatedLine::Last |
Definition at line 107 of file TokenAnnotator.h.
Referenced by AnnotatedLine(), clang::format::AffectedRangeManager::computeAffectedLines(), endsWith(), clang::format::UnwrappedLineFormatter::format(), clang::format::isFunctionDeclarationName(), mightBeFunctionDefinition(), and clang::format::ContinuationIndenter::mustBreak().
bool clang::format::AnnotatedLine::LeadingEmptyLinesAffected |
True
if the leading empty lines of this line intersect with one of the input ranges.
Definition at line 124 of file TokenAnnotator.h.
Referenced by clang::format::AffectedRangeManager::computeAffectedLines(), and clang::format::UnwrappedLineFormatter::format().
unsigned clang::format::AnnotatedLine::Level |
Definition at line 112 of file TokenAnnotator.h.
Referenced by clang::format::UnwrappedLineFormatter::format(), clang::format::ContinuationIndenter::getInitialState(), and clang::format::TokenAnnotator::setCommentLineLevels().
bool clang::format::AnnotatedLine::MightBeFunctionDecl |
Definition at line 115 of file TokenAnnotator.h.
Referenced by clang::format::TokenAnnotator::calculateFormattingInformation(), and mightBeFunctionDefinition().
bool clang::format::AnnotatedLine::MustBeDeclaration |
Definition at line 114 of file TokenAnnotator.h.
LineType clang::format::AnnotatedLine::Type |
Definition at line 111 of file TokenAnnotator.h.
Referenced by clang::format::TokenAnnotator::annotate(), and clang::format::UnwrappedLineFormatter::format().