Home
last modified time | relevance | path

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

12

/freebsd-13.1/contrib/llvm-project/clang/lib/Format/
H A DTokenAnnotator.h55 FormatToken *Current = First; in AnnotatedLine()
77 FormatToken *Current = First; in ~AnnotatedLine()
123 FormatToken *First;
124 FormatToken *Last;
173 unsigned splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok,
176 bool spaceRequiredBeforeParens(const FormatToken &Right) const;
179 const FormatToken &Right);
185 bool canBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
195 FormatToken *calculateInitializerColumnList(AnnotatedLine &Line,
196 FormatToken *CurrentToken,
[all …]
H A DFormatTokenLexer.h42 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator,
45 ArrayRef<FormatToken *> lex();
65 bool precedesOperand(FormatToken *Tok);
67 bool canPrecedeRegexLiteral(FormatToken *Prev);
94 FormatToken *getStashedToken();
96 FormatToken *getNextToken();
98 FormatToken *FormatTok;
110 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator;
113 SmallVector<FormatToken *, 16> Tokens;
125 void readRawToken(FormatToken &Tok);
H A DMacroExpander.cpp37 SmallVector<FormatToken *, 8> Params;
38 SmallVector<FormatToken *, 8> Body;
117 FormatToken *Current = nullptr;
119 ArrayRef<FormatToken *> Tokens;
158 llvm::SmallVector<FormatToken *, 8> MacroExpander::expand(FormatToken *ID, in expand()
161 SmallVector<FormatToken *, 8> Result; in expand()
168 auto pushToken = [&](FormatToken *Tok) { in expand()
175 auto expandArgument = [&](FormatToken *Tok) -> bool { in expand()
189 for (FormatToken *Arg : Args[I->getValue()]) { in expand()
203 for (FormatToken *Tok : Def.Body) { in expand()
[all …]
H A DNamespaceEndCommentsFixer.cpp27 std::string computeName(const FormatToken *NamespaceTok) { in computeName()
47 const FormatToken *FirstNSTok = Tok; in computeName()
82 bool hasEndComment(const FormatToken *RBraceTok) { in hasEndComment()
87 const FormatToken *NamespaceTok) { in validEndComment()
89 const FormatToken *Comment = RBraceTok->Next; in validEndComment()
159 const FormatToken *Comment = RBraceTok->Next; in updateEndComment()
170 const FormatToken *
210 FormatToken *Tok = AnnotatedLines[I]->First; in analyze()
229 const FormatToken *NamespaceTok = in analyze()
233 FormatToken *RBraceTok = EndLine->First; in analyze()
[all …]
H A DUnwrappedLineParser.h79 unsigned FirstStartColumn, ArrayRef<FormatToken *> Tokens,
169 void distributeComments(const SmallVectorImpl<FormatToken *> &Comments,
170 const FormatToken *NextTok);
174 void pushToken(FormatToken *Tok);
186 bool isOnNewLine(const FormatToken &FormatTok);
202 SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
203 FormatToken *FormatTok;
235 ArrayRef<FormatToken *> AllTokens;
289 FormatToken *IncludeGuardToken;
302 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} in UnwrappedLineNode()
[all …]
H A DContinuationIndenter.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()
221 const FormatToken *Tok;
411 FormatToken *NextToken;
H A DMacros.h91 using ArgsList = llvm::ArrayRef<llvm::SmallVector<FormatToken *, 8>>;
108 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator,
121 llvm::SmallVector<FormatToken *, 8> expand(FormatToken *ID,
132 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator;
H A DFormatToken.h156 struct FormatToken;
210 struct FormatToken { struct
211 FormatToken() in FormatToken() function
424 FormatToken *NextOperator = nullptr; argument
430 FormatToken *Previous = nullptr; argument
433 FormatToken *Next = nullptr; argument
641 FormatToken *Tok = Previous; in getPreviousNonComment()
649 const FormatToken *Tok = Next; in getNextNonComment()
676 const FormatToken *T = this; in isCppStructuredBinding() argument
710 FormatToken(const FormatToken &) = delete;
[all …]
H A DBreakableToken.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,
493 FormatToken *LastLineTok = nullptr;
H A DAffectedRangeManager.h22 struct FormatToken;
42 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
47 bool affectsLeadingEmptyLines(const FormatToken &Tok);
H A DTokenAnnotator.cpp233 FormatToken *Prev = Left; in parseParens()
826 void updateParameterCount(FormatToken *Left, FormatToken *Current) { in updateParameterCount()
869 FormatToken *Tok = CurrentToken; in consumeToken()
1554 static FormatToken *untilMatchingParen(FormatToken *Current) { in untilMatchingParen()
2107 FormatToken *CurrentToken;
2154 FormatToken *Start = Current; in parse()
2293 FormatToken *Start = Current; in parseConditionalExpr()
2317 FormatToken *Current;
2403 auto skipOperatorName = [](const FormatToken *Next) -> const FormatToken * { in isFunctionDeclarationName()
2658 FormatToken *Current = Line.Last; in calculateUnbreakableTailLengths()
[all …]
H A DFormatToken.cpp39 bool FormatToken::isSimpleTypeSpecifier() const { in isSimpleTypeSpecifier()
74 void TokenRole::precomputeFormattingInfos(const FormatToken *Token) {} in precomputeFormattingInfos()
86 const FormatToken *LBrace = in formatAfterToken()
147 static unsigned CodePointsBetween(const FormatToken *Begin, in CodePointsBetween()
148 const FormatToken *End) { in CodePointsBetween()
153 void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { in precomputeFormattingInfos()
176 FormatToken *ItemBegin = Token->Next; in precomputeFormattingInfos()
196 const FormatToken *ItemEnd = nullptr; in precomputeFormattingInfos()
199 const FormatToken *NonCommentEnd = ItemEnd->getPreviousNonComment(); in precomputeFormattingInfos()
H A DUnwrappedLineParser.cpp126 FormatToken FakeEOF;
129 FormatToken *&ResetToken;
133 FormatToken *Token;
134 FormatToken *PreviousToken;
219 ArrayRef<FormatToken *> Tokens;
399 FormatToken *Next; in parseLevel()
446 FormatToken *Tok = FormatTok; in calculateBraceTypes()
455 FormatToken *NextTok; in calculateBraceTypes()
1011 static bool isC78ParameterDecl(const FormatToken *Tok, const FormatToken *Next, in isC78ParameterDecl()
1052 FormatToken *Next = FormatTok; in readTokenWithJavaScriptASI()
[all …]
H A DContinuationIndenter.cpp79 FormatToken *End = Tok.MatchingParen; in getLengthToMatchingParen()
122 const FormatToken &Previous = *Current.Previous; in startsNextParameter()
278 const FormatToken &Current = *State.NextToken; in canBreak()
330 const FormatToken &Current = *State.NextToken; in mustBreak()
528 const FormatToken &Current = *State.NextToken; in addTokenToState()
564 FormatToken &Current = *State.NextToken; in addTokenOnCurrentLine()
571 const FormatToken *Tok = &Previous; in addTokenOnCurrentLine()
758 FormatToken &Current = *State.NextToken; in addTokenOnNewLine()
966 FormatToken &Current = *State.NextToken; in getNewLineColumn()
1524 for (const FormatToken *Tok = &Current; in moveStatePastScopeOpener()
[all …]
H A DAffectedRangeManager.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()
H A DWhitespaceManager.h54 void replaceWhitespace(FormatToken &Tok, unsigned Newlines, unsigned Spaces,
62 void addUntouchableToken(const FormatToken &Tok, bool InPPDirective);
80 void replaceWhitespaceInToken(const FormatToken &Tok, unsigned Offset,
111 Change(const FormatToken &Tok, bool CreateReplacement,
121 const FormatToken *Tok;
H A DFormatTokenLexer.cpp63 ArrayRef<FormatToken *> FormatTokenLexer::lex() { in lex()
504 FormatToken *RegexToken = Tokens.back(); in tryParseJSRegexLiteral()
508 FormatToken *Prev = nullptr; in tryParseJSRegexLiteral()
621 FormatToken *BacktickToken = Tokens.back(); in handleTemplateStrings()
688 FormatToken *HashToken = Tokens.back(); in tryParsePythonComment()
711 FormatToken *Last = Tokens.back(); in tryMerge_TMacro()
715 FormatToken *String = Tokens[Tokens.size() - 2]; in tryMerge_TMacro()
722 FormatToken *Macro = Tokens[Tokens.size() - 4]; in tryMerge_TMacro()
791 FormatToken *Next = Tokens.back(); in tryMergeConflictMarkers()
807 FormatToken *FormatTokenLexer::getStashedToken() { in getStashedToken()
[all …]
H A DUnwrappedLineFormatter.cpp146 const FormatToken *getMatchingNamespaceToken( in getMatchingNamespaceToken()
166 const FormatToken *NamespaceToken = in getMatchingNamespaceTokenText()
242 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
376 const FormatToken *Previous = I[-1]->Last; in tryFitMultipleLinesInOne()
384 const FormatToken *PreviousPrevious = in tryFitMultipleLinesInOne()
427 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne()
621 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
632 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
759 static void markFinalized(FormatToken *Tok) { in markFinalized()
1250 FormatToken &RootToken = *Line.First; in formatFirstToken()
[all …]
H A DTokenAnalyzer.cpp67 llvm::SpecificBumpPtrAllocator<FormatToken> Allocator; in process()
73 ArrayRef<FormatToken *> Toks(Lex.lex()); in process()
74 SmallVector<FormatToken *, 10> Tokens(Toks.begin(), Toks.end()); in process()
H A DSortJavaScriptImports.cpp211 FormatToken *Current;
212 FormatToken *LineEnd;
214 FormatToken invalidToken;
220 FormatToken *skipComments(FormatToken *Tok) { in skipComments()
H A DBreakableToken.cpp219 bool switchesFormatting(const FormatToken &Token) { in switchesFormatting()
268 const FormatToken &Tok, unsigned StartColumn, StringRef Prefix, in BreakableStringLiteral()
295 BreakableComment::BreakableComment(const FormatToken &Token, in BreakableComment()
332 const FormatToken &BreakableComment::tokenAt(unsigned LineIndex) const { in tokenAt()
367 const FormatToken &Token, unsigned StartColumn, in BreakableBlockComment()
754 const FormatToken &Token, unsigned StartColumn, bool InPPDirective, in BreakableLineCommentSection()
759 FormatToken *LineTok = nullptr; in BreakableLineCommentSection()
763 for (const FormatToken *CurrentTok = &Tok; in BreakableLineCommentSection()
H A DNamespaceEndCommentsFixer.h29 const FormatToken *
H A DWhitespaceManager.cpp29 WhitespaceManager::Change::Change(const FormatToken &Tok, in Change()
48 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines, in replaceWhitespace()
61 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok, in addUntouchableToken()
78 const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars, in replaceWhitespaceInToken()
610 const FormatToken *Current = C.Tok; in alignConsecutiveMacros()
765 for (FormatToken *Next = C.Tok->Next; Next; Next = Next->Next) { in alignConsecutiveDeclarations()
796 FormatToken *Previous = C.Tok->getPreviousNonComment(); in alignChainedConditionals()
1122 const FormatToken *MatchingParen = nullptr; in getCells()
H A DUsingDeclarationsSorter.cpp87 std::string computeUsingDeclarationLabel(const FormatToken *UsingTok) { in computeUsingDeclarationLabel()
90 const FormatToken *Tok = UsingTok->Next; in computeUsingDeclarationLabel()
H A DFormat.cpp1605 for (FormatToken *FormatTok = Line->First; FormatTok; in requoteJSStringLiteral()
1764 FormatToken *Tok = AnnotatedLines[i]->First->Next; in deriveLocalStyle()
1827 for (FormatToken *FormatTok = Line->First; FormatTok; in insertTrailingCommas()
1831 FormatToken *Matching = FormatTok->MatchingParen; in insertTrailingCommas()
1838 FormatToken *Prev = FormatTok->getPreviousNonComment(); in insertTrailingCommas()
1927 FormatToken *Tok = AnnotatedLines[Line]->First; in checkEmptyNamespace()
1999 auto NextNotDeleted = [this](const FormatToken &Tok) -> FormatToken * { in cleanupPair()
2034 inline void deleteToken(FormatToken *Tok) { in deleteToken()
2041 std::vector<FormatToken *> Tokens; in generateFixes()
2077 bool operator()(const FormatToken *LHS, const FormatToken *RHS) const { in operator ()()
[all …]

12