Lines Matching defs:FormatToken
210 struct FormatToken { struct
211 FormatToken() in FormatToken() argument
231 /// FIXME: Make FormatToken for parsing and AnnotatedToken two different argument
233 std::shared_ptr<TokenRole> Role;
236 SourceRange WhitespaceRange;
240 unsigned HasUnescapedNewline : 1;
243 unsigned IsMultiline : 1;
246 unsigned IsFirst : 1;
252 unsigned MustBreakBefore : 1;
255 unsigned IsUnterminatedLiteral : 1;
258 unsigned CanBreakBefore : 1;
261 unsigned ClosesTemplateDeclaration : 1;
265 unsigned StartsBinaryExpression : 1;
267 unsigned EndsBinaryExpression : 1;
272 unsigned PartOfMultiVariableDeclStmt : 1;
277 unsigned ContinuesLineCommentSection : 1;
282 unsigned Finalized : 1;
289 BraceBlockKind getBlockKind() const { in getBlockKind()
292 void setBlockKind(BraceBlockKind BBK) { in setBlockKind()
302 FormatDecision getDecision() const { in getDecision()
305 void setDecision(FormatDecision D) { in setDecision()
315 ParameterPackingKind getPackingKind() const { in getPackingKind()
318 void setPackingKind(ParameterPackingKind K) { in setPackingKind()
329 TokenType getType() const { return Type; } in getType()
330 void setType(TokenType T) { Type = T; } in setType()
336 unsigned NewlinesBefore = 0;
340 unsigned LastNewlineOffset = 0;
345 unsigned ColumnWidth = 0;
349 unsigned LastLineColumnWidth = 0;
352 unsigned SpacesRequiredBefore = 0;
355 unsigned ParameterCount = 0;
359 unsigned BlockParameterCount = 0;
363 tok::TokenKind ParentBracket = tok::unknown;
367 unsigned TotalLength = 0;
371 unsigned OriginalColumn = 0;
375 unsigned UnbreakableTailLength = 0;
380 unsigned BindingStrength = 0;
384 unsigned NestingLevel = 0;
387 unsigned IndentLevel = 0;
390 unsigned SplitPenalty = 0;
397 unsigned LongestObjCSelectorName = 0;
424 FormatToken *NextOperator = nullptr; argument
427 FormatToken *MatchingParen = nullptr; argument
430 FormatToken *Previous = nullptr; argument
433 FormatToken *Next = nullptr; argument
437 SmallVector<AnnotatedLine *, 1> Children;
441 llvm::Optional<MacroExpansion> MacroCtx;
443 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); } in is()
444 bool is(TokenType TT) const { return getType() == TT; } in is()
445 bool is(const IdentifierInfo *II) const { in is()
448 bool is(tok::PPKeywordKind Kind) const { in is()
452 bool is(BraceBlockKind BBK) const { return getBlockKind() == BBK; } in is()
453 bool is(ParameterPackingKind PPK) const { return getPackingKind() == PPK; } in is()
455 template <typename A, typename B> bool isOneOf(A K1, B K2) const { in isOneOf()
459 bool isOneOf(A K1, B K2, Ts... Ks) const { in isOneOf()
462 template <typename T> bool isNot(T Kind) const { return !is(Kind); } in isNot()
469 bool closesScopeAfterBlock() const { in closesScopeAfterBlock()
480 bool startsSequence(A K1, Ts... Tokens) const { in startsSequence()
491 bool endsSequence(A K1, Ts... Tokens) const { in endsSequence()
495 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); } in isStringLiteral()
497 bool isObjCAtKeyword(tok::ObjCKeywordKind Kind) const { in isObjCAtKeyword()
506 bool canBePointerOrReferenceQualifier() const { in canBePointerOrReferenceQualifier()
516 bool isObjCAccessSpecifier() const { in isObjCAccessSpecifier()
526 bool opensScope() const { in opensScope()
536 bool closesScope() const { in closesScope()
546 bool isMemberAccess() const { in isMemberAccess()
552 bool isUnaryOperator() const { in isUnaryOperator()
568 bool isBinaryOperator() const { in isBinaryOperator()
573 bool isTrailingComment() const { in isTrailingComment()
580 bool isFunctionLikeKeyword() const { in isFunctionLikeKeyword()
603 bool isLabelString() const { in isLabelString()
631 FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
639 const FormatToken *getNextNonComment() const { in getNextNonComment() argument
667 const FormatToken *T = this; in isCppStructuredBinding() argument
684 const FormatToken *getNamespaceToken() const { in getNamespaceToken() argument
697 void copyFrom(const FormatToken &Tok) { *this = Tok; } in copyFrom() argument
702 FormatToken &operator=(const FormatToken &) = default; argument
705 bool startsSequenceInternal(A K1, Ts... Tokens) const { in startsSequenceInternal()
711 template <typename A> bool startsSequenceInternal(A K1) const { in startsSequenceInternal()
717 template <typename A, typename... Ts> bool endsSequenceInternal(A K1) const { in endsSequenceInternal()
741 virtual void precomputeFormattingInfos(const FormatToken *Token); argument