Home
last modified time | relevance | path

Searched refs:FormatToken (Results 1 – 23 of 23) sorted by relevance

/freebsd-11-stable/contrib/llvm-project/clang/lib/Format/
HDNamespaceEndCommentsFixer.cpp31 std::string computeName(const FormatToken *NamespaceTok) { in computeName()
36 const FormatToken *Tok = NamespaceTok->getNextNonComment(); in computeName()
51 const FormatToken *FirstNSTok = Tok; in computeName()
69 const FormatToken *NamespaceTok) { in computeEndCommentText()
84 bool hasEndComment(const FormatToken *RBraceTok) { in hasEndComment()
88 bool validEndComment(const FormatToken *RBraceTok, StringRef NamespaceName, in validEndComment()
89 const FormatToken *NamespaceTok) { in validEndComment()
91 const FormatToken *Comment = RBraceTok->Next; in validEndComment()
127 void addEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in addEndComment()
139 void updateEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in updateEndComment()
[all …]
HDFormatTokenLexer.h42 ArrayRef<FormatToken *> lex();
61 bool precedesOperand(FormatToken *Tok);
63 bool canPrecedeRegexLiteral(FormatToken *Prev);
88 FormatToken *getStashedToken();
90 FormatToken *getNextToken();
92 FormatToken *FormatTok;
104 llvm::SpecificBumpPtrAllocator<FormatToken> Allocator;
107 SmallVector<FormatToken *, 16> Tokens;
116 void readRawToken(FormatToken &Tok);
HDUnwrappedLineParser.h79 unsigned FirstStartColumn, ArrayRef<FormatToken *> Tokens,
150 void distributeComments(const SmallVectorImpl<FormatToken *> &Comments,
151 const FormatToken *NextTok);
155 void pushToken(FormatToken *Tok);
167 bool isOnNewLine(const FormatToken &FormatTok);
183 SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
184 FormatToken *FormatTok;
216 ArrayRef<FormatToken *> AllTokens;
270 FormatToken *IncludeGuardToken;
283 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} in UnwrappedLineNode()
[all …]
HDTokenAnnotator.h54 FormatToken *Current = First; in AnnotatedLine()
76 FormatToken *Current = First; in ~AnnotatedLine()
122 FormatToken *First;
123 FormatToken *Last;
172 unsigned splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok,
175 bool spaceRequiredBeforeParens(const FormatToken &Right) const;
177 bool spaceRequiredBetween(const AnnotatedLine &Line, const FormatToken &Left,
178 const FormatToken &Right);
180 bool spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Right);
182 bool mustBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
[all …]
HDContinuationIndenter.h32 struct FormatToken;
111 unsigned reformatRawStringLiteral(const FormatToken &Current,
118 unsigned handleEndOfLine(const FormatToken &Current, LineState &State,
123 llvm::Optional<FormatStyle> getRawStringStyle(const FormatToken &Current,
144 std::pair<unsigned, bool> breakProtrudingToken(const FormatToken &Current,
152 createBreakableToken(const FormatToken &Current, LineState &State,
182 unsigned addMultilineToken(const FormatToken &Current, LineState &State);
202 ParenState(const FormatToken *Tok, unsigned Indent, unsigned LastSpace, in ParenState()
218 const FormatToken *Tok;
381 FormatToken *NextToken;
HDFormatToken.h131 struct FormatToken { struct
132 FormatToken() {} in FormatToken() argument
281 FormatToken *NextOperator = nullptr; argument
294 FormatToken *MatchingParen = nullptr; argument
297 FormatToken *Previous = nullptr; argument
300 FormatToken *Next = nullptr; argument
489 FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
490 FormatToken *Tok = Previous; in getPreviousNonComment()
497 const FormatToken *getNextNonComment() const { in getNextNonComment() argument
498 const FormatToken *Tok = Next; in getNextNonComment()
[all …]
HDBreakableToken.h32 bool switchesFormatting(const FormatToken &Token);
234 BreakableToken(const FormatToken &Tok, bool InPPDirective, in BreakableToken()
239 const FormatToken &Tok;
251 BreakableStringLiteral(const FormatToken &Tok, unsigned StartColumn,
292 BreakableComment(const FormatToken &Token, unsigned StartColumn,
307 const FormatToken &tokenAt(unsigned LineIndex) const;
329 SmallVector<FormatToken *, 16> Tokens;
359 BreakableBlockComment(const FormatToken &Token, unsigned StartColumn,
438 BreakableLineCommentSection(const FormatToken &Token, unsigned StartColumn,
486 FormatToken *LastLineTok = nullptr;
HDTokenAnnotator.cpp40 static bool canBeObjCSelectorComponent(const FormatToken &Tok) { in canBeObjCSelectorComponent()
46 static bool isLambdaParameterList(const FormatToken *Left) { in isLambdaParameterList()
81 const FormatToken &Previous = *CurrentToken->Previous; // The '<'. in parseAngle()
91 FormatToken *Left = CurrentToken->Previous; in parseAngle()
150 if (FormatToken *Previous = CurrentToken->getPreviousNonComment()) { in parseAngle()
166 FormatToken *Left = CurrentToken->Previous; in parseParens()
175 if (FormatToken *MaybeSel = Left->Previous) { in parseParens()
253 FormatToken *PossibleObjCForInToken = nullptr; in parseParens()
260 FormatToken *Prev = CurrentToken->getPreviousNonComment(); in parseParens()
262 FormatToken *PrevPrev = Prev->getPreviousNonComment(); in parseParens()
[all …]
HDFormatToken.cpp39 bool FormatToken::isSimpleTypeSpecifier() const { in isSimpleTypeSpecifier()
72 void TokenRole::precomputeFormattingInfos(const FormatToken *Token) {} in precomputeFormattingInfos()
84 const FormatToken *LBrace = in formatAfterToken()
145 static unsigned CodePointsBetween(const FormatToken *Begin, in CodePointsBetween()
146 const FormatToken *End) { in CodePointsBetween()
151 void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { in precomputeFormattingInfos()
174 FormatToken *ItemBegin = Token->Next; in precomputeFormattingInfos()
194 const FormatToken *ItemEnd = nullptr; in precomputeFormattingInfos()
197 const FormatToken *NonCommentEnd = ItemEnd->getPreviousNonComment(); in precomputeFormattingInfos()
HDAffectedRangeManager.h22 struct FormatToken;
42 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
47 bool affectsLeadingEmptyLines(const FormatToken &Tok);
HDUnwrappedLineParser.cpp30 virtual FormatToken *getNextToken() = 0;
33 virtual FormatToken *setPosition(unsigned Position) = 0;
59 static bool isLineComment(const FormatToken &FormatTok) { in isLineComment()
66 static bool continuesLineComment(const FormatToken &FormatTok, in continuesLineComment()
67 const FormatToken *Previous, in continuesLineComment()
68 const FormatToken *MinColumnToken) { in continuesLineComment()
81 FormatToken *&ResetToken) in ScopedMacroState()
99 FormatToken *getNextToken() override { in getNextToken()
112 FormatToken *setPosition(unsigned Position) override { in setPosition()
125 FormatToken FakeEOF;
[all …]
HDWhitespaceManager.h51 void replaceWhitespace(FormatToken &Tok, unsigned Newlines, unsigned Spaces,
59 void addUntouchableToken(const FormatToken &Tok, bool InPPDirective);
77 void replaceWhitespaceInToken(const FormatToken &Tok, unsigned Offset,
108 Change(const FormatToken &Tok, bool CreateReplacement,
118 const FormatToken *Tok;
HDContinuationIndenter.cpp37 static unsigned getLengthToMatchingParen(const FormatToken &Tok, in getLengthToMatchingParen()
79 FormatToken *End = Tok.MatchingParen; in getLengthToMatchingParen()
86 auto FindParenState = [&](const FormatToken *LBrace) -> const ParenState * { in getLengthToMatchingParen()
107 static unsigned getLengthToNextOperator(const FormatToken &Tok) { in getLengthToNextOperator()
115 static bool startsSegmentOfBuilderTypeCall(const FormatToken &Tok) { in startsSegmentOfBuilderTypeCall()
120 static bool startsNextParameter(const FormatToken &Current, in startsNextParameter()
122 const FormatToken &Previous = *Current.Previous; in startsNextParameter()
136 static bool opensProtoMessageField(const FormatToken &LessTok, in opensProtoMessageField()
278 const FormatToken &Current = *State.NextToken; in canBreak()
279 const FormatToken &Previous = *Current.Previous; in canBreak()
[all …]
HDAffectedRangeManager.cpp35 FormatToken *Last = Line->Last; in computeAffectedLines()
72 bool AffectedRangeManager::affectsTokenRange(const FormatToken &First, in affectsTokenRange()
73 const FormatToken &Last, in affectsTokenRange()
84 bool AffectedRangeManager::affectsLeadingEmptyLines(const FormatToken &Tok) { in affectsLeadingEmptyLines()
119 for (FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in nonPPLineAffected()
HDFormatTokenLexer.cpp48 ArrayRef<FormatToken *> FormatTokenLexer::lex() { in lex()
317 SmallVectorImpl<FormatToken *>::const_iterator First = in tryMergeTokens()
337 bool FormatTokenLexer::precedesOperand(FormatToken *Tok) { in precedesOperand()
350 bool FormatTokenLexer::canPrecedeRegexLiteral(FormatToken *Prev) { in canPrecedeRegexLiteral()
376 FormatToken *RegexToken = Tokens.back(); in tryParseJSRegexLiteral()
380 FormatToken *Prev = nullptr; in tryParseJSRegexLiteral()
431 FormatToken *BacktickToken = Tokens.back(); in handleTemplateStrings()
498 FormatToken *HashToken = Tokens.back(); in tryParsePythonComment()
521 FormatToken *Last = Tokens.back(); in tryMerge_TMacro()
525 FormatToken *String = Tokens[Tokens.size() - 2]; in tryMerge_TMacro()
[all …]
HDUnwrappedLineFormatter.cpp23 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
24 const FormatToken *NextNext = Next ? Next->getNextNonComment() : nullptr; in startsExternCBlock()
95 int getIndentOffset(const FormatToken &RootToken) { in getIndentOffset()
137 const FormatToken *getMatchingNamespaceToken( in getMatchingNamespaceToken()
150 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
157 const FormatToken *NamespaceToken = in getMatchingNamespaceTokenText()
233 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
538 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
582 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
593 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
[all …]
HDSortJavaScriptImports.cpp206 FormatToken *Current;
207 FormatToken *LineEnd;
209 FormatToken invalidToken;
215 FormatToken *skipComments(FormatToken *Tok) { in skipComments()
HDBreakableToken.cpp186 bool switchesFormatting(const FormatToken &Token) { in switchesFormatting()
235 const FormatToken &Tok, unsigned StartColumn, StringRef Prefix, in BreakableStringLiteral()
262 BreakableComment::BreakableComment(const FormatToken &Token, in BreakableComment()
299 const FormatToken &BreakableComment::tokenAt(unsigned LineIndex) const { in tokenAt()
334 const FormatToken &Token, unsigned StartColumn, in BreakableBlockComment()
722 const FormatToken &Token, unsigned StartColumn, in BreakableLineCommentSection()
728 FormatToken *LineTok = nullptr; in BreakableLineCommentSection()
729 for (const FormatToken *CurrentTok = &Tok; in BreakableLineCommentSection()
HDWhitespaceManager.cpp27 WhitespaceManager::Change::Change(const FormatToken &Tok, in Change()
45 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines, in replaceWhitespace()
58 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok, in addUntouchableToken()
75 const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars, in replaceWhitespaceInToken()
482 const FormatToken *Current = C.Tok; in alignConsecutiveMacros()
596 for (FormatToken *Next = C.Tok->Next; Next; Next = Next->Next) { in alignConsecutiveDeclarations()
HDFormat.cpp1280 for (FormatToken *FormatTok = Line->First; FormatTok; in requoteJSStringLiteral()
1399 for (FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) { in hasCpp03IncompatibleFormat()
1416 for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Next) { in countVariableAlignments()
1439 FormatToken *Tok = AnnotatedLines[i]->First->Next; in deriveLocalStyle()
1513 for (FormatToken *Tok = Line.First; Tok != nullptr; Tok = Tok->Next) { in containsOnlyComments()
1531 FormatToken *Tok = AnnotatedLines[Line]->First; in checkEmptyNamespace()
1601 void cleanupPair(FormatToken *Start, LeftKind LK, RightKind RK, in cleanupPair()
1603 auto NextNotDeleted = [this](const FormatToken &Tok) -> FormatToken * { in cleanupPair()
1628 void cleanupLeft(FormatToken *Start, LeftKind LK, RightKind RK) { in cleanupLeft()
1633 void cleanupRight(FormatToken *Start, LeftKind LK, RightKind RK) { in cleanupRight()
[all …]
HDNamespaceEndCommentsFixer.h29 const FormatToken *
HDUsingDeclarationsSorter.cpp87 std::string computeUsingDeclarationLabel(const FormatToken *UsingTok) { in computeUsingDeclarationLabel()
90 const FormatToken *Tok = UsingTok->Next; in computeUsingDeclarationLabel()
/freebsd-11-stable/lib/clang/libclang/
HDMakefile351 SRCS_EXT+= Format/FormatToken.cpp