Home
last modified time | relevance | path

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

/freebsd-12.1/contrib/llvm/tools/clang/lib/Format/
H A DFormatTokenLexer.h43 ArrayRef<FormatToken *> lex();
56 bool precedesOperand(FormatToken *Tok);
58 bool canPrecedeRegexLiteral(FormatToken *Prev);
83 FormatToken *getStashedToken();
85 FormatToken *getNextToken();
87 FormatToken *FormatTok;
99 llvm::SpecificBumpPtrAllocator<FormatToken> Allocator;
102 SmallVector<FormatToken *, 16> Tokens;
111 void readRawToken(FormatToken &Tok);
H A DUnwrappedLineParser.h81 ArrayRef<FormatToken *> Tokens,
152 void distributeComments(const SmallVectorImpl<FormatToken *> &Comments,
153 const FormatToken *NextTok);
157 void pushToken(FormatToken *Tok);
169 bool isOnNewLine(const FormatToken &FormatTok);
185 SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
186 FormatToken *FormatTok;
218 ArrayRef<FormatToken *> AllTokens;
272 FormatToken *IncludeGuardToken;
285 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} in UnwrappedLineNode()
[all …]
H A DNamespaceEndCommentsFixer.cpp32 std::string computeName(const FormatToken *NamespaceTok) { in computeName()
37 const FormatToken *Tok = NamespaceTok->getNextNonComment(); in computeName()
56 bool hasEndComment(const FormatToken *RBraceTok) { in hasEndComment()
62 const FormatToken *Comment = RBraceTok->Next; in validEndComment()
85 void addEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in addEndComment()
101 const FormatToken *Comment = RBraceTok->Next; in updateEndComment()
112 const FormatToken *
146 const FormatToken *NamespaceTok = in analyze()
150 FormatToken *RBraceTok = EndLine->First; in analyze()
154 const FormatToken *EndCommentPrevTok = RBraceTok; in analyze()
[all …]
H A DTokenAnnotator.h55 FormatToken *Current = First; in AnnotatedLine()
77 FormatToken *Current = First; in ~AnnotatedLine()
115 FormatToken *First;
116 FormatToken *Last;
165 unsigned splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok,
168 bool spaceRequiredBetween(const AnnotatedLine &Line, const FormatToken &Left,
169 const FormatToken &Right);
171 bool spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Right);
173 bool mustBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
175 bool canBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
H A DFormatToken.h124 struct FormatToken { struct
125 FormatToken() {} in FormatToken() function
274 FormatToken *NextOperator = nullptr; argument
287 FormatToken *MatchingParen = nullptr; argument
290 FormatToken *Previous = nullptr; argument
293 FormatToken *Next = nullptr; argument
474 FormatToken *Tok = Previous; in getPreviousNonComment()
482 const FormatToken *Tok = Next; in getNextNonComment()
507 const FormatToken *T = this; in isCppStructuredBinding() argument
525 const FormatToken *NamespaceTok = this; in getNamespaceToken()
[all …]
H A DContinuationIndenter.h33 struct FormatToken;
112 unsigned reformatRawStringLiteral(const FormatToken &Current,
119 unsigned handleEndOfLine(const FormatToken &Current, LineState &State,
124 llvm::Optional<FormatStyle> getRawStringStyle(const FormatToken &Current,
145 std::pair<unsigned, bool> breakProtrudingToken(const FormatToken &Current,
153 createBreakableToken(const FormatToken &Current, LineState &State,
183 unsigned addMultilineToken(const FormatToken &Current, LineState &State);
203 ParenState(const FormatToken *Tok, unsigned Indent, unsigned LastSpace, in ParenState()
219 const FormatToken *Tok;
382 FormatToken *NextToken;
H A DBreakableToken.h33 bool switchesFormatting(const FormatToken &Token);
239 BreakableToken(const FormatToken &Tok, bool InPPDirective, in BreakableToken()
244 const FormatToken &Tok;
256 BreakableStringLiteral(const FormatToken &Tok, unsigned StartColumn,
297 BreakableComment(const FormatToken &Token, unsigned StartColumn,
312 const FormatToken &tokenAt(unsigned LineIndex) const;
334 SmallVector<FormatToken *, 16> Tokens;
364 BreakableBlockComment(const FormatToken &Token, unsigned StartColumn,
440 BreakableLineCommentSection(const FormatToken &Token, unsigned StartColumn,
488 FormatToken *LastLineTok = nullptr;
H A DTokenAnnotator.cpp342 FormatToken *Tok = CurrentToken; in parseParens()
567 FormatToken *Tok = CurrentToken; in parseSquare()
629 void updateParameterCount(FormatToken *Left, FormatToken *Current) { in updateParameterCount()
672 FormatToken *Tok = CurrentToken; in consumeToken()
1680 FormatToken *CurrentToken;
1727 FormatToken *Start = Current; in parse()
1866 FormatToken *Start = Current; in parseConditionalExpr()
1890 FormatToken *Current;
1973 auto skipOperatorName = [](const FormatToken *Next) -> const FormatToken * { in isFunctionDeclarationName()
2189 FormatToken *Current = Line.Last; in calculateUnbreakableTailLengths()
[all …]
H A DFormatToken.cpp40 bool FormatToken::isSimpleTypeSpecifier() const { in isSimpleTypeSpecifier()
73 void TokenRole::precomputeFormattingInfos(const FormatToken *Token) {} in precomputeFormattingInfos()
85 const FormatToken *LBrace = in formatAfterToken()
146 static unsigned CodePointsBetween(const FormatToken *Begin, in CodePointsBetween()
147 const FormatToken *End) { in CodePointsBetween()
152 void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { in precomputeFormattingInfos()
175 FormatToken *ItemBegin = Token->Next; in precomputeFormattingInfos()
195 const FormatToken *ItemEnd = nullptr; in precomputeFormattingInfos()
198 const FormatToken *NonCommentEnd = ItemEnd->getPreviousNonComment(); in precomputeFormattingInfos()
H A DAffectedRangeManager.h23 struct FormatToken;
43 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
48 bool affectsLeadingEmptyLines(const FormatToken &Tok);
H A DWhitespaceManager.h50 void replaceWhitespace(FormatToken &Tok, unsigned Newlines, unsigned Spaces,
58 void addUntouchableToken(const FormatToken &Tok, bool InPPDirective);
76 void replaceWhitespaceInToken(const FormatToken &Tok, unsigned Offset,
107 Change(const FormatToken &Tok, bool CreateReplacement,
117 const FormatToken *Tok;
H A DUnwrappedLineParser.cpp31 virtual FormatToken *getNextToken() = 0;
126 FormatToken FakeEOF;
129 FormatToken *&ResetToken;
133 FormatToken *Token;
134 FormatToken *PreviousToken;
214 ArrayRef<FormatToken *> Tokens;
353 FormatToken *Next; in parseLevel()
393 FormatToken *Tok = FormatTok; in calculateBraceTypes()
402 FormatToken *NextTok; in calculateBraceTypes()
931 FormatToken *Next = FormatTok; in readTokenWithJavaScriptASI()
[all …]
H A DFormatTokenLexer.cpp45 ArrayRef<FormatToken *> FormatTokenLexer::lex() { in lex()
215 FormatToken *RegexToken = Tokens.back(); in tryParseJSRegexLiteral()
219 FormatToken *Prev = nullptr; in tryParseJSRegexLiteral()
270 FormatToken *BacktickToken = Tokens.back(); in handleTemplateStrings()
337 FormatToken *HashToken = Tokens.back(); in tryParsePythonComment()
360 FormatToken *Last = Tokens.back(); in tryMerge_TMacro()
364 FormatToken *String = Tokens[Tokens.size() - 2]; in tryMerge_TMacro()
371 FormatToken *Macro = Tokens[Tokens.size() - 4]; in tryMerge_TMacro()
440 FormatToken *Next = Tokens.back(); in tryMergeConflictMarkers()
456 FormatToken *FormatTokenLexer::getStashedToken() { in getStashedToken()
[all …]
H A DContinuationIndenter.cpp80 FormatToken *End = Tok.MatchingParen; in getLengthToMatchingParen()
123 const FormatToken &Previous = *Current.Previous; in startsNextParameter()
279 const FormatToken &Current = *State.NextToken; in canBreak()
280 const FormatToken &Previous = *Current.Previous; in canBreak()
331 const FormatToken &Current = *State.NextToken; in mustBreak()
507 const FormatToken &Current = *State.NextToken; in addTokenToState()
543 FormatToken &Current = *State.NextToken; in addTokenOnCurrentLine()
550 const FormatToken *Tok = &Previous; in addTokenOnCurrentLine()
729 FormatToken &Current = *State.NextToken; in addTokenOnNewLine()
901 FormatToken &Current = *State.NextToken; in getNewLineColumn()
[all …]
H A DAffectedRangeManager.cpp36 FormatToken *Last = Line->Last; in computeAffectedLines()
73 bool AffectedRangeManager::affectsTokenRange(const FormatToken &First, in affectsTokenRange()
74 const FormatToken &Last, in affectsTokenRange()
85 bool AffectedRangeManager::affectsLeadingEmptyLines(const FormatToken &Tok) { in affectsLeadingEmptyLines()
120 for (FormatToken *Tok = Line->First; Tok; Tok = Tok->Next) { in nonPPLineAffected()
H A DUnwrappedLineFormatter.cpp24 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
96 int getIndentOffset(const FormatToken &RootToken) { in getIndentOffset()
139 const FormatToken *NamespaceTok = Line->First; in isNamespaceDeclaration()
225 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
494 const FormatToken *Tok = Line.First->getNextNonComment(); in tryMergeSimpleBlock()
536 FormatToken *Tok = I[1]->First; in tryMergeSimpleBlock()
547 FormatToken *RecordTok = Line.First; in tryMergeSimpleBlock()
648 for (FormatToken *Tok = B.First; Tok; Tok = Tok->Next) { in join()
662 static void markFinalized(FormatToken *Tok) { in markFinalized()
723 FormatToken &Previous = *State.NextToken->Previous; in formatChildren()
[all …]
H A DSortJavaScriptImports.cpp208 FormatToken *Current;
209 FormatToken *LineEnd;
211 FormatToken invalidToken;
217 FormatToken *skipComments(FormatToken *Tok) { in skipComments()
H A DBreakableToken.cpp185 bool switchesFormatting(const FormatToken &Token) { in switchesFormatting()
234 const FormatToken &Tok, unsigned StartColumn, StringRef Prefix, in BreakableStringLiteral()
261 BreakableComment::BreakableComment(const FormatToken &Token, in BreakableComment()
298 const FormatToken &BreakableComment::tokenAt(unsigned LineIndex) const { in tokenAt()
333 const FormatToken &Token, unsigned StartColumn, in BreakableBlockComment()
710 const FormatToken &Token, unsigned StartColumn, in BreakableLineCommentSection()
716 FormatToken *LineTok = nullptr; in BreakableLineCommentSection()
717 for (const FormatToken *CurrentTok = &Tok; in BreakableLineCommentSection()
H A DFormat.cpp1098 for (FormatToken *FormatTok = Line->First; FormatTok; in requoteJSStringLiteral()
1251 FormatToken *Tok = AnnotatedLines[i]->First->Next; in deriveLocalStyle()
1336 FormatToken *Tok = AnnotatedLines[Line]->First; in checkEmptyNamespace()
1406 void cleanupPair(FormatToken *Start, LeftKind LK, RightKind RK, in cleanupPair()
1408 auto NextNotDeleted = [this](const FormatToken &Tok) -> FormatToken * { in cleanupPair()
1433 void cleanupLeft(FormatToken *Start, LeftKind LK, RightKind RK) { in cleanupLeft()
1443 inline void deleteToken(FormatToken *Tok) { in deleteToken()
1450 std::vector<FormatToken *> Tokens; in generateFixes()
1486 bool operator()(const FormatToken *LHS, const FormatToken *RHS) const { in operator ()()
1494 std::set<FormatToken *, FormatTokenLess> DeletedTokens;
[all …]
H A DNamespaceEndCommentsFixer.h30 const FormatToken *
H A DUsingDeclarationsSorter.cpp88 std::string computeUsingDeclarationLabel(const FormatToken *UsingTok) { in computeUsingDeclarationLabel()
91 const FormatToken *Tok = UsingTok->Next; in computeUsingDeclarationLabel()
H A DWhitespaceManager.cpp28 WhitespaceManager::Change::Change(const FormatToken &Tok, in Change()
46 void WhitespaceManager::replaceWhitespace(FormatToken &Tok, unsigned Newlines, in replaceWhitespace()
59 void WhitespaceManager::addUntouchableToken(const FormatToken &Tok, in addUntouchableToken()
76 const FormatToken &Tok, unsigned Offset, unsigned ReplaceChars, in replaceWhitespaceInToken()
/freebsd-12.1/lib/clang/libclang/
H A DMakefile316 SRCS_EXT+= Format/FormatToken.cpp