Home
last modified time | relevance | path

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

123

/external/llvm-project/clang/lib/Format/
DFormatTokenLexer.h42 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator,
45 ArrayRef<FormatToken *> lex();
66 bool precedesOperand(FormatToken *Tok);
68 bool canPrecedeRegexLiteral(FormatToken *Prev);
95 FormatToken *getStashedToken();
97 FormatToken *getNextToken();
99 FormatToken *FormatTok;
111 llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator;
114 SmallVector<FormatToken *, 16> Tokens;
126 void readRawToken(FormatToken &Tok);
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 …]
DNamespaceEndCommentsFixer.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()
145 void addEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in addEndComment()
157 void updateEndComment(const FormatToken *RBraceTok, StringRef EndCommentText, in updateEndComment()
[all …]
DUnwrappedLineParser.h79 unsigned FirstStartColumn, ArrayRef<FormatToken *> Tokens,
162 void distributeComments(const SmallVectorImpl<FormatToken *> &Comments,
163 const FormatToken *NextTok);
167 void pushToken(FormatToken *Tok);
179 bool isOnNewLine(const FormatToken &FormatTok);
195 SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
196 FormatToken *FormatTok;
228 ArrayRef<FormatToken *> AllTokens;
282 FormatToken *IncludeGuardToken;
295 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} in UnwrappedLineNode()
[all …]
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 …]
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;
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;
DFormatToken.h156 struct FormatToken;
195 llvm::SmallVector<FormatToken *, 1> ExpandedFrom;
210 struct FormatToken { struct
211 FormatToken() in FormatToken() argument
424 FormatToken *NextOperator = nullptr; argument
427 FormatToken *MatchingParen = nullptr; argument
430 FormatToken *Previous = nullptr; argument
433 FormatToken *Next = nullptr; argument
631 FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
632 FormatToken *Tok = Previous; in getPreviousNonComment()
[all …]
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,
486 FormatToken *LastLineTok = nullptr;
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()
163 if (FormatToken *Previous = CurrentToken->getPreviousNonComment()) { in parseAngle()
200 FormatToken *Left = CurrentToken->Previous; in parseParens()
202 FormatToken *PrevNonComment = Left->getPreviousNonComment(); in parseParens()
216 if (FormatToken *MaybeSel = Left->Previous) { in parseParens()
306 FormatToken *PossibleObjCForInToken = nullptr; in parseParens()
[all …]
DAffectedRangeManager.h22 struct FormatToken;
42 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
47 bool affectsLeadingEmptyLines(const FormatToken &Tok);
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()
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;
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 …]
/external/clang/lib/Format/
DFormatTokenLexer.h34 ArrayRef<FormatToken *> lex();
46 bool precedesOperand(FormatToken *Tok);
48 bool canPrecedeRegexLiteral(FormatToken *Prev);
62 FormatToken *getStashedToken();
64 FormatToken *getNextToken();
66 FormatToken *FormatTok;
78 llvm::SpecificBumpPtrAllocator<FormatToken> Allocator;
81 SmallVector<FormatToken *, 16> Tokens;
89 void readRawToken(FormatToken &Tok);
DUnwrappedLineParser.h65 ArrayRef<FormatToken *> Tokens,
114 const FormatToken *getPreviousToken();
117 void pushToken(FormatToken *Tok);
129 bool isOnNewLine(const FormatToken &FormatTok);
140 SmallVector<FormatToken *, 1> CommentsBeforeNextToken;
141 FormatToken *FormatTok;
171 ArrayRef<FormatToken *> AllTokens;
210 UnwrappedLineNode(FormatToken *Tok) : Tok(Tok) {} in UnwrappedLineNode()
212 FormatToken *Tok;
DTokenAnnotator.h53 FormatToken *Current = First; in AnnotatedLine()
75 FormatToken *Current = First; in ~AnnotatedLine()
106 FormatToken *First;
107 FormatToken *Last;
152 unsigned splitPenalty(const AnnotatedLine &Line, const FormatToken &Tok,
155 bool spaceRequiredBetween(const AnnotatedLine &Line, const FormatToken &Left,
156 const FormatToken &Right);
158 bool spaceRequiredBefore(const AnnotatedLine &Line, const FormatToken &Tok);
160 bool mustBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
162 bool canBreakBefore(const AnnotatedLine &Line, const FormatToken &Right);
DFormatToken.h113 struct FormatToken { struct
114 FormatToken() {} in FormatToken() argument
254 FormatToken *NextOperator = nullptr; argument
262 FormatToken *MatchingParen = nullptr; argument
265 FormatToken *Previous = nullptr; argument
268 FormatToken *Next = nullptr; argument
413 FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
414 FormatToken *Tok = Previous; in getPreviousNonComment()
421 const FormatToken *getNextNonComment() const { in getNextNonComment() argument
422 const FormatToken *Tok = Next; in getNextNonComment()
[all …]
DAffectedRangeManager.h23 struct FormatToken;
44 bool affectsTokenRange(const FormatToken &First, const FormatToken &Last,
49 bool affectsLeadingEmptyLines(const FormatToken &Tok);
DFormatToken.cpp42 bool FormatToken::isSimpleTypeSpecifier() const { in isSimpleTypeSpecifier()
73 void TokenRole::precomputeFormattingInfos(const FormatToken *Token) {} in precomputeFormattingInfos()
82 const FormatToken *LBrace = in formatAfterToken()
140 static unsigned CodePointsBetween(const FormatToken *Begin, in CodePointsBetween()
141 const FormatToken *End) { in CodePointsBetween()
146 void CommaSeparatedList::precomputeFormattingInfos(const FormatToken *Token) { in precomputeFormattingInfos()
169 FormatToken *ItemBegin = Token->Next; in precomputeFormattingInfos()
189 const FormatToken *ItemEnd = nullptr; in precomputeFormattingInfos()
192 const FormatToken *NonCommentEnd = ItemEnd->getPreviousNonComment(); in precomputeFormattingInfos()
DTokenAnnotator.cpp50 const FormatToken& Previous = *CurrentToken->Previous; in parseAngle()
60 FormatToken *Left = CurrentToken->Previous; in parseAngle()
115 FormatToken *Left = CurrentToken->Previous; in parseParens()
127 } else if (FormatToken *MaybeSel = Left->Previous) { in parseParens()
201 FormatToken *Prev = CurrentToken->getPreviousNonComment(); in parseParens()
203 FormatToken *PrevPrev = Prev->getPreviousNonComment(); in parseParens()
204 FormatToken *Next = CurrentToken->Next; in parseParens()
235 for (FormatToken *Tok = Left; Tok != CurrentToken; Tok = Tok->Next) { in parseParens()
288 FormatToken *Tok = CurrentToken; in parseParens()
305 FormatToken *Left = CurrentToken->Previous; in parseSquare()
[all …]
DBreakableToken.h75 BreakableToken(const FormatToken &Tok, unsigned IndentLevel, in BreakableToken()
81 const FormatToken &Tok;
98 BreakableSingleLineToken(const FormatToken &Tok, unsigned IndentLevel,
120 BreakableStringLiteral(const FormatToken &Tok, unsigned IndentLevel,
139 BreakableLineComment(const FormatToken &Token, unsigned IndentLevel,
165 BreakableBlockComment(const FormatToken &Token, unsigned IndentLevel,
DContinuationIndenter.cpp31 static unsigned getLengthToMatchingParen(const FormatToken &Tok) { in getLengthToMatchingParen()
34 FormatToken *End = Tok.MatchingParen; in getLengthToMatchingParen()
41 static unsigned getLengthToNextOperator(const FormatToken &Tok) { in getLengthToNextOperator()
49 static bool startsSegmentOfBuilderTypeCall(const FormatToken &Tok) { in startsSegmentOfBuilderTypeCall()
54 static bool startsNextParameter(const FormatToken &Current, in startsNextParameter()
56 const FormatToken &Previous = *Current.Previous; in startsNextParameter()
99 const FormatToken &Current = *State.NextToken; in canBreak()
100 const FormatToken &Previous = *Current.Previous; in canBreak()
143 const FormatToken &Current = *State.NextToken; in mustBreak()
144 const FormatToken &Previous = *Current.Previous; in mustBreak()
[all …]
DFormatTokenLexer.cpp45 ArrayRef<FormatToken *> FormatTokenLexer::lex() { in lex()
119 SmallVectorImpl<FormatToken *>::const_iterator First = in tryMergeTokens()
140 bool FormatTokenLexer::precedesOperand(FormatToken *Tok) { in precedesOperand()
153 bool FormatTokenLexer::canPrecedeRegexLiteral(FormatToken *Prev) { in canPrecedeRegexLiteral()
177 FormatToken *RegexToken = Tokens.back(); in tryParseJSRegexLiteral()
181 FormatToken *Prev = nullptr; in tryParseJSRegexLiteral()
232 FormatToken *BacktickToken = Tokens.back(); in tryParseTemplateString()
271 FormatToken *Last = Tokens.back(); in tryMerge_TMacro()
275 FormatToken *String = Tokens[Tokens.size() - 2]; in tryMerge_TMacro()
282 FormatToken *Macro = Tokens[Tokens.size() - 4]; in tryMerge_TMacro()
[all …]
/external/llvm-project/clang/unittests/Format/
DTestLexer.h32 typedef llvm::SmallVector<FormatToken *, 8> TokenList;
34 inline std::ostream &operator<<(std::ostream &Stream, const FormatToken &Tok) {
53 inline std::string text(llvm::ArrayRef<FormatToken *> Tokens) { in text()
55 [](const std::string &R, FormatToken *Tok) { in text()
62 TestLexer(llvm::SpecificBumpPtrAllocator<FormatToken> &Allocator,
70 ArrayRef<FormatToken *> Result = Lex.lex(); in lex()
89 FormatToken *id(llvm::StringRef Code) { in id()
111 llvm::SpecificBumpPtrAllocator<FormatToken>& Allocator;

123