|
clang
5.0.0
|
Public Member Functions | |
| BreakableLineCommentSection (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... | |
| void | updateNextToken (LineState &State) const override |
Updates the next token of State to the next token after this one. 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... | |
Definition at line 353 of file BreakableToken.h.
| clang::format::BreakableLineCommentSection::BreakableLineCommentSection | ( | const FormatToken & | Token, |
| unsigned | StartColumn, | ||
| unsigned | OriginalStartColumn, | ||
| bool | FirstInLine, | ||
| bool | InPPDirective, | ||
| encoding::Encoding | Encoding, | ||
| const FormatStyle & | Style | ||
| ) |
Definition at line 676 of file BreakableToken.cpp.
References clang::format::Blanks, clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableComment::ContentColumn, clang::format::getLineCommentIndentPrefix(), clang::format::FormatToken::is(), clang::isAlphanumeric(), clang::format::BreakableComment::Lines, clang::format::FormatStyle::TabWidth, clang::format::BreakableToken::Tok, and clang::format::BreakableComment::Tokens.
|
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 763 of file BreakableToken.cpp.
References clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableComment::ContentColumn, clang::format::BreakableToken::Encoding, 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 804 of file BreakableToken.cpp.
References clang::format::encoding::columnWidthWithTabs(), clang::format::BreakableToken::Encoding, getLineLengthAfterSplit(), clang::format::BreakableComment::ReflowPrefix, clang::format::BreakableToken::Style, and clang::format::FormatStyle::TabWidth.
|
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 795 of file BreakableToken.cpp.
References 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 774 of file BreakableToken.cpp.
References clang::format::BreakableToken::InPPDirective, 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 898 of file BreakableToken.cpp.
References 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 823 of file BreakableToken.cpp.
References clang::format::BreakableComment::ContentColumn, insertBreak(), clang::format::BreakableComment::Lines, clang::format::BreakableComment::ReflowPrefix, clang::format::WhitespaceManager::replaceWhitespace(), clang::format::WhitespaceManager::replaceWhitespaceInToken(), clang::format::BreakableComment::tokenAt(), clang::format::BreakableComment::Tokens, and clang::format::FormatToken::TokenText.
|
overridevirtual |
Updates the next token of State to the next token after this one.
This can be used when this token manages a set of underlying tokens as a unit and is responsible for the formatting of the them.
Reimplemented from clang::format::BreakableToken.
Definition at line 892 of file BreakableToken.cpp.
References clang::format::FormatToken::Next, and clang::format::LineState::NextToken.
1.8.6