|
clang
5.0.0
|
Public Member Functions | |
| BreakableBlockComment (const FormatToken &Token, unsigned StartColumn, unsigned OriginalStartColumn, bool FirstInLine, bool InPPDirective, encoding::Encoding Encoding, const FormatStyle &Style) | |
| unsigned | getLineLengthAfterSplit (unsigned LineIndex, unsigned TailOffset, StringRef::size_type Length) const override |
Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset with length Length. More... | |
| void | insertBreak (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) override |
Emits the previously retrieved Split via Whitespaces. More... | |
| Split | getSplitBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) const override |
Returns a whitespace range (offset, length) of the content at LineIndex such that the content preceding this range needs to be reformatted before any breaks are made to this line. More... | |
| unsigned | getLineLengthAfterSplitBefore (unsigned LineIndex, unsigned TailOffset, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore) const override |
Returns the number of columns required to format the piece of line at LineIndex after the content preceding the whitespace range specified SplitBefore has been reformatted, but before any breaks are made to this line. More... | |
| void | replaceWhitespaceBefore (unsigned LineIndex, unsigned PreviousEndColumn, unsigned ColumnLimit, Split SplitBefore, WhitespaceManager &Whitespaces) override |
Replaces the whitespace between LineIndex-1 and LineIndex. More... | |
| bool | mayReflow (unsigned LineIndex, llvm::Regex &CommentPragmasRegex) const override |
Public Member Functions inherited from clang::format::BreakableComment | |
| unsigned | getLineCount () const override |
| Returns the number of lines in this token in the original code. More... | |
| Split | getSplit (unsigned LineIndex, unsigned TailOffset, unsigned ColumnLimit, llvm::Regex &CommentPragmasRegex) const override |
Returns a range (offset, length) at which to break the line at LineIndex, if previously broken at TailOffset. More... | |
| void | compressWhitespace (unsigned LineIndex, unsigned TailOffset, Split Split, WhitespaceManager &Whitespaces) override |
Replaces the whitespace range described by Split with a single space. More... | |
Public Member Functions inherited from clang::format::BreakableToken | |
| virtual | ~BreakableToken () |
| unsigned | getLineLengthAfterCompression (unsigned RemainingTokenColumns, Split Split) const |
Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset after the whitespace range Split has been compressed into a single space. More... | |
| virtual void | updateNextToken (LineState &State) const |
Updates the next token of State to the next token after this one. More... | |
Definition at line 285 of file BreakableToken.h.
| clang::format::BreakableBlockComment::BreakableBlockComment | ( | const FormatToken & | Token, |
| unsigned | StartColumn, | ||
| unsigned | OriginalStartColumn, | ||
| bool | FirstInLine, | ||
| bool | InPPDirective, | ||
| encoding::Encoding | Encoding, | ||
| const FormatStyle & | Style | ||
| ) |
Definition at line 338 of file BreakableToken.cpp.
References clang::format::BreakableComment::Content, clang::format::BreakableComment::ContentColumn, clang::format::FormatToken::is(), clang::format::BreakableComment::Lines, max(), clang::format::BreakableComment::StartColumn, clang::format::BreakableToken::Tok, clang::format::BreakableComment::Tokens, and clang::format::FormatToken::TokenText.
|
overridevirtual |
Returns the number of columns required to format the piece of line at LineIndex, from byte offset TailOffset with length Length.
Note that previous breaks are not taken into account. TailOffset is always specified from the start of the (original) line. Length can be set to StringRef::npos, which means "to the end of line".
Implements clang::format::BreakableToken.
Definition at line 480 of file BreakableToken.cpp.
References clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableComment::Content, clang::format::BreakableToken::Encoding, clang::format::BreakableComment::Lines, clang::format::BreakableToken::Style, and clang::format::FormatStyle::TabWidth.
Referenced by getLineLengthAfterSplitBefore().
|
overridevirtual |
Returns the number of columns required to format the piece of line at LineIndex after the content preceding the whitespace range specified SplitBefore has been reformatted, but before any breaks are made to this line.
Reimplemented from clang::format::BreakableToken.
Definition at line 557 of file BreakableToken.cpp.
References clang::format::Blanks, and getLineLengthAfterSplit().
|
overridevirtual |
Returns a whitespace range (offset, length) of the content at LineIndex such that the content preceding this range needs to be reformatted before any breaks are made to this line.
PreviousEndColumn is the end column of the previous line after formatting.
A result having offset == StringRef::npos means that no piece of the line needs to be reformatted before any breaks are made.
Reimplemented from clang::format::BreakableToken.
Definition at line 529 of file BreakableToken.cpp.
References clang::format::Blanks, clang::format::BreakableComment::Content, clang::format::BreakableComment::getReflowSplit(), mayReflow(), and clang::format::BreakableComment::ReflowPrefix.
|
overridevirtual |
Emits the previously retrieved Split via Whitespaces.
Implements clang::format::BreakableToken.
Definition at line 501 of file BreakableToken.cpp.
References clang::format::BreakableComment::Content, clang::format::BreakableToken::InPPDirective, clang::format::BreakableComment::Lines, clang::format::WhitespaceManager::replaceWhitespaceInToken(), Text, clang::format::BreakableComment::tokenAt(), and clang::format::FormatToken::TokenText.
Referenced by replaceWhitespaceBefore().
|
overridevirtual |
Implements clang::format::BreakableComment.
Definition at line 654 of file BreakableToken.cpp.
References clang::format::Blanks, clang::format::FormatToken::Finalized, clang::format::BreakableComment::Lines, clang::format::mayReflowContent(), clang::format::switchesFormatting(), clang::format::BreakableToken::Tok, and clang::format::BreakableComment::tokenAt().
Referenced by getSplitBefore().
|
overridevirtual |
Replaces the whitespace between LineIndex-1 and LineIndex.
Performs a reformatting of the content at LineIndex preceding the whitespace range SplitBefore.
Reimplemented from clang::format::BreakableToken.
Definition at line 583 of file BreakableToken.cpp.
References clang::format::Blanks, clang::format::BreakableComment::ContentColumn, clang::format::BreakableToken::InPPDirective, insertBreak(), clang::format::BreakableComment::Lines, clang::format::BreakableComment::ReflowPrefix, clang::format::WhitespaceManager::replaceWhitespaceInToken(), clang::format::BreakableComment::tokenAt(), clang::format::BreakableComment::Tokens, and clang::format::FormatToken::TokenText.
1.8.6