Lines Matching full:content
74 << ", Content start: " << ContentStartColumn << "\n");
222 StringRef Content = Token.TokenText.substr(2).ltrim();
223 return Content.starts_with("clang-format on") ||
224 Content.starts_with("clang-format off");
230 // Example: consider the content
423 if (CommentPragmasRegex.match(Content[LineIndex]))
425 return getCommentSplit(Content[LineIndex].substr(TailOffset),
433 StringRef Text = Content[LineIndex].substr(TailOffset);
434 // Text is relative to the content line, but Whitespaces operates relative to
450 static bool mayReflowContent(StringRef Content) {
451 Content = Content.trim(Blanks);
457 if (Content.starts_with(Prefix)) {
468 hasSpecialMeaningPrefix || kNumberedListRegexp.match(Content);
470 // Simple heuristic for what to reflow: content should contain at least two
473 return Content.size() >= 2 && !hasSpecialMeaningPrefix &&
474 !Content.ends_with("\\") &&
475 // Note that this is UTF-8 safe, since if isPunctuation(Content[0]) is
477 (!isPunctuation(Content[0]) || !isPunctuation(Content[1]));
496 Content.resize(Lines.size());
497 Content[0] = Lines[0];
514 if (Lines.size() >= 2 && Content[1].starts_with("**") &&
528 for (size_t i = 1, e = Content.size(); i < e && !Decoration.empty(); ++i) {
529 const StringRef &Text = Content[i];
544 if (Content[i].empty()) {
565 unsigned DecorationSize = Decoration.starts_with(Content[i])
566 ? Content[i].size()
570 Content[i] = Content[i].substr(DecorationSize);
571 if (!Decoration.starts_with(Content[i])) {
600 llvm::dbgs() << i << " |" << Content[i] << "| "
602 << "IN=" << (Content[i].data() - Lines[i].data()) << "\n";
611 if (CommentPragmasRegex.match(Content[LineIndex]))
613 return getCommentSplit(Content[LineIndex].substr(TailOffset),
644 Content[LineIndex - 1].data() - Lines[LineIndex - 1].data();
645 Content[LineIndex - 1] = Lines[LineIndex - 1].substr(
647 Content[LineIndex] = Lines[LineIndex].substr(StartOfLine);
660 Content[LineIndex].substr(Offset, Length), StartColumn, Style.TabWidth,
673 bool HasRemainingText = Offset < Content[LineIndex].size();
699 // The content at LineIndex 0 of a comment like:
702 StringRef ContentWithNoDecoration = Content[LineIndex];
715 StringRef Text = Content[LineIndex].substr(TailOffset);
748 // If we're reflowing into a line with content indent, only reflow the next
749 // line if its starting whitespace matches the content indent.
750 size_t Trimmed = Content[LineIndex].find_first_not_of(Blanks);
770 StringRef TrimmedContent = Content[LineIndex].ltrim(Blanks);
776 unsigned WhitespaceOffsetInToken = Content[LineIndex - 1].data() +
777 Content[LineIndex - 1].size() -
808 if (Content[LineIndex].empty()) {
826 unsigned WhitespaceOffsetInToken = Content[LineIndex - 1].data() +
827 Content[LineIndex - 1].size() -
829 unsigned WhitespaceLength = Content[LineIndex].data() -
843 StringRef Line = Content.back().substr(TailOffset);
853 // Content[LineIndex] may exclude the indent after the '*' decoration. In that
855 StringRef IndentContent = Content[LineIndex];
859 mayReflowContent(Content[LineIndex]) && !Tok.Finalized &&
883 Content.resize(Lines.size());
971 // If the IndentPrefix is the whole line, there is no content and we
977 Content[i] = Lines[i].substr(IndentPrefix.size());
983 size_t EndOfLine = Content[i].find_last_not_of(Blanks);
985 EndOfLine = Content[i].size();
988 Content[i] = Content[i].substr(0, EndOfLine);
1016 Content[LineIndex].substr(Offset, Length), StartColumn, Style.TabWidth,
1029 StringRef Text = Content[LineIndex].substr(TailOffset);
1046 size_t Trimmed = Content[LineIndex].find_first_not_of(Blanks);
1051 // line up to where the content starts.
1094 Content[LineIndex].data() - Lines[LineIndex].data();
1116 // content column after a possible update to the prefix, hence the prefix
1120 (Content[LineIndex].data() - Lines[LineIndex].data()) +
1154 StringRef IndentContent = Content[LineIndex];
1164 mayReflowContent(Content[LineIndex]) && !Tok.Finalized &&