Home
last modified time | relevance | path

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

12

/netbsd-src/external/apache2/llvm/dist/clang/lib/Format/
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;
51 DefinitionParser(ArrayRef<FormatToken *> Tokens) : Tokens(Tokens) { in DefinitionParser()
117 FormatToken *Current = nullptr;
119 ArrayRef<FormatToken *> Tokens;
125 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator, in MacroExpander()
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()
[all …]
H A DNamespaceEndCommentsFixer.cpp27 std::string computeName(const FormatToken *NamespaceTok) { in computeName()
32 const FormatToken *Tok = NamespaceTok->getNextNonComment(); in computeName()
47 const FormatToken *FirstNSTok = Tok; in computeName()
65 const FormatToken *NamespaceTok, in computeEndCommentText()
82 bool hasEndComment(const FormatToken *RBraceTok) { in hasEndComment()
86 bool validEndComment(const FormatToken *RBraceTok, StringRef NamespaceName, in validEndComment()
87 const FormatToken *NamespaceTok) { in validEndComment()
89 const FormatToken *Comment = RBraceTok->Next; in validEndComment()
143 void addEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in addEndComment()
155 void updateEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in updateEndComment()
[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 DTokenAnnotator.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 …]
H A DFormatToken.h155 struct FormatToken;
194 llvm::SmallVector<FormatToken *, 1> ExpandedFrom;
209 struct FormatToken { struct
210 FormatToken() in FormatToken() function
423 FormatToken *NextOperator = nullptr; argument
426 FormatToken *MatchingParen = nullptr; argument
429 FormatToken *Previous = nullptr; argument
432 FormatToken *Next = nullptr; argument
630 FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
631 FormatToken *Tok = Previous; in getPreviousNonComment()
[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 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 DTokenAnnotator.cpp40 static bool canBeObjCSelectorComponent(const FormatToken &Tok) { in canBeObjCSelectorComponent()
46 static bool isLambdaParameterList(const FormatToken *Left) { in isLambdaParameterList()
61 static bool isKeywordWithCondition(const FormatToken &Tok) { in isKeywordWithCondition()
88 const FormatToken &Previous = *CurrentToken->Previous; // The '<'. in parseAngle()
98 FormatToken *Left = CurrentToken->Previous; in parseAngle()
170 if (FormatToken *Previous = CurrentToken->getPreviousNonComment()) { in parseAngle()
207 FormatToken *Left = CurrentToken->Previous; in parseParens()
209 FormatToken *PrevNonComment = Left->getPreviousNonComment(); in parseParens()
223 if (FormatToken *MaybeSel = Left->Previous) { in parseParens()
313 FormatToken *PossibleObjCForInToken = nullptr; in parseParens()
[all …]
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.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 DAffectedRangeManager.h22 struct FormatToken;
42 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
47 bool affectsLeadingEmptyLines(const FormatToken &Tok);
H A DUnwrappedLineParser.cpp31 virtual FormatToken *getNextToken() = 0;
34 virtual FormatToken *setPosition(unsigned Position) = 0;
60 static bool isLineComment(const FormatToken &FormatTok) { in isLineComment()
67 static bool continuesLineComment(const FormatToken &FormatTok, in continuesLineComment()
68 const FormatToken *Previous, in continuesLineComment()
69 const FormatToken *MinColumnToken) { in continuesLineComment()
82 FormatToken *&ResetToken) in ScopedMacroState()
100 FormatToken *getNextToken() override { in getNextToken()
113 FormatToken *setPosition(unsigned Position) override { in setPosition()
126 FormatToken FakeEOF;
[all …]
H A DWhitespaceManager.h52 void replaceWhitespace(FormatToken &Tok, unsigned Newlines, unsigned Spaces,
60 void addUntouchableToken(const FormatToken &Tok, bool InPPDirective);
78 void replaceWhitespaceInToken(const FormatToken &Tok, unsigned Offset,
109 Change(const FormatToken &Tok, bool CreateReplacement,
119 const FormatToken *Tok;
H A DContinuationIndenter.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 …]
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 DFormatTokenLexer.cpp28 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator, in FormatTokenLexer()
61 ArrayRef<FormatToken *> FormatTokenLexer::lex() { in lex()
443 SmallVectorImpl<FormatToken *>::const_iterator First = in tryMergeTokens()
463 bool FormatTokenLexer::precedesOperand(FormatToken *Tok) { in precedesOperand()
476 bool FormatTokenLexer::canPrecedeRegexLiteral(FormatToken *Prev) { in canPrecedeRegexLiteral()
502 FormatToken *RegexToken = Tokens.back(); in tryParseJSRegexLiteral()
506 FormatToken *Prev = nullptr; in tryParseJSRegexLiteral()
557 FormatToken *CSharpStringLiteral = Tokens.back(); in handleCSharpVerbatimAndInterpolatedStrings()
619 FormatToken *BacktickToken = Tokens.back(); in handleTemplateStrings()
686 FormatToken *HashToken = Tokens.back(); in tryParsePythonComment()
[all …]
H A DUnwrappedLineFormatter.cpp23 const FormatToken *Next = Line.First->getNextNonComment(); in startsExternCBlock()
24 const FormatToken *NextNext = Next ? Next->getNextNonComment() : nullptr; in startsExternCBlock()
97 int getIndentOffset(const FormatToken &RootToken) { in getIndentOffset()
144 const FormatToken *getMatchingNamespaceToken( in getMatchingNamespaceToken()
157 const FormatToken *NamespaceToken = Line->First->getNamespaceToken(); in getNamespaceTokenText()
164 const FormatToken *NamespaceToken = in getMatchingNamespaceTokenText()
240 const FormatToken *Tok = I[-1]->First; in tryFitMultipleLinesInOne()
374 const FormatToken *Previous = I[-1]->Last; in tryFitMultipleLinesInOne()
382 const FormatToken *PreviousPrevious = in tryFitMultipleLinesInOne()
425 const FormatToken *First = TheLine->First; in tryFitMultipleLinesInOne()
[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 DWhitespaceManager.cpp27 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()
589 const FormatToken *Current = C.Tok; in alignConsecutiveMacros()
750 for (FormatToken *Next = C.Tok->Next; Next; Next = Next->Next) { in alignConsecutiveDeclarations()
781 FormatToken *Previous = C.Tok->getPreviousNonComment(); in alignChainedConditionals()
H A DFormat.cpp1558 for (FormatToken *FormatTok = Line->First; FormatTok; in requoteJSStringLiteral()
1677 for (FormatToken *Tok = Line->First->Next; Tok; Tok = Tok->Next) { in hasCpp03IncompatibleFormat()
1694 for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Next) { in countVariableAlignments()
1717 FormatToken *Tok = AnnotatedLines[i]->First->Next; in deriveLocalStyle()
1778 for (FormatToken *FormatTok = Line->First; FormatTok; in insertTrailingCommas()
1782 FormatToken *Matching = FormatTok->MatchingParen; in insertTrailingCommas()
1789 FormatToken *Prev = FormatTok->getPreviousNonComment(); in insertTrailingCommas()
1860 for (FormatToken *Tok = Line.First; Tok != nullptr; Tok = Tok->Next) { in containsOnlyComments()
1878 FormatToken *Tok = AnnotatedLines[Line]->First; in checkEmptyNamespace()
1948 void cleanupPair(FormatToken *Start, LeftKind LK, RightKind RK, in cleanupPair()
[all …]
H A DNamespaceEndCommentsFixer.h29 const FormatToken *
H A DCMakeLists.txt8 FormatToken.cpp

12