Lines Matching defs:FormatToken

298 struct FormatToken {  struct
299 FormatToken() in FormatToken() argument
322 /// FIXME: Make FormatToken for parsing and AnnotatedToken two different argument
324 std::shared_ptr<TokenRole> Role;
327 SourceRange WhitespaceRange;
331 unsigned HasUnescapedNewline : 1;
334 unsigned IsMultiline : 1;
337 unsigned IsFirst : 1;
343 unsigned MustBreakBefore : 1;
347 unsigned MustBreakBeforeFinalized : 1;
350 unsigned IsUnterminatedLiteral : 1;
353 unsigned CanBreakBefore : 1;
356 unsigned ClosesTemplateDeclaration : 1;
360 unsigned StartsBinaryExpression : 1;
362 unsigned EndsBinaryExpression : 1;
367 unsigned PartOfMultiVariableDeclStmt : 1;
372 unsigned ContinuesLineCommentSection : 1;
377 unsigned Finalized : 1;
380 unsigned ClosesRequiresClause : 1;
383 unsigned EndsCppAttributeGroup : 1;
390 BraceBlockKind getBlockKind() const { in getBlockKind()
393 void setBlockKind(BraceBlockKind BBK) { in setBlockKind()
403 FormatDecision getDecision() const { in getDecision()
406 void setDecision(FormatDecision D) { in setDecision()
416 ParameterPackingKind getPackingKind() const { in getPackingKind()
419 void setPackingKind(ParameterPackingKind K) { in setPackingKind()
426 TokenType Type;
431 TokenType getType() const { return Type; } in getType()
432 void setType(TokenType T) { in setType()
446 void setFinalizedType(TokenType T) { in setFinalizedType()
452 void overwriteFixedType(TokenType T) { in overwriteFixedType()
458 bool isTypeFinalized() const { return TypeIsFinalized; } in isTypeFinalized()
461 prec::Level ForcedPrecedence = prec::Unknown;
467 unsigned NewlinesBefore = 0;
473 int Newlines = -1;
477 unsigned LastNewlineOffset = 0;
482 unsigned ColumnWidth = 0;
486 unsigned LastLineColumnWidth = 0;
489 unsigned SpacesRequiredBefore = 0;
492 unsigned ParameterCount = 0;
496 unsigned BlockParameterCount = 0;
500 tok::TokenKind ParentBracket = tok::unknown;
504 unsigned TotalLength = 0;
508 unsigned OriginalColumn = 0;
512 unsigned UnbreakableTailLength = 0;
517 unsigned BindingStrength = 0;
521 unsigned NestingLevel = 0;
524 unsigned IndentLevel = 0;
527 unsigned SplitPenalty = 0;
534 unsigned LongestObjCSelectorName = 0;
561 FormatToken *NextOperator = nullptr; argument
564 FormatToken *MatchingParen = nullptr; argument
567 FormatToken *Previous = nullptr; argument
570 FormatToken *Next = nullptr; argument
573 bool StartsColumn = false;
576 bool ArrayInitializerLineStart = false;
579 bool IsArrayInitializer = false;
582 bool Optional = false;
585 bool MightBeFunctionDeclParen = false;
591 int8_t BraceCount = 0;
595 SmallVector<AnnotatedLine *, 1> Children;
599 std::optional<MacroExpansion> MacroCtx;
608 bool MacroParent = false;
610 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); } in is()
611 bool is(TokenType TT) const { return getType() == TT; } in is()
612 bool is(const IdentifierInfo *II) const { in is()
615 bool is(tok::PPKeywordKind Kind) const { in is()
619 bool is(BraceBlockKind BBK) const { return getBlockKind() == BBK; } in is()
620 bool is(ParameterPackingKind PPK) const { return getPackingKind() == PPK; } in is()
622 template <typename A, typename B> bool isOneOf(A K1, B K2) const { in isOneOf()
626 bool isOneOf(A K1, B K2, Ts... Ks) const { in isOneOf()
629 template <typename T> bool isNot(T Kind) const { return !is(Kind); } in isNot()
636 bool closesScopeAfterBlock() const { in closesScopeAfterBlock()
647 bool startsSequence(A K1, Ts... Tokens) const { in startsSequence()
658 bool endsSequence(A K1, Ts... Tokens) const { in endsSequence()
662 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); } in isStringLiteral()
664 bool isAttribute() const { in isAttribute()
668 bool isObjCAtKeyword(tok::ObjCKeywordKind Kind) const { in isObjCAtKeyword()
672 bool isAccessSpecifierKeyword() const { in isAccessSpecifierKeyword()
681 const auto *NextNonComment = getNextNonComment();
685 bool canBePointerOrReferenceQualifier() const { in canBePointerOrReferenceQualifier()
696 bool isObjCAccessSpecifier() const { in isObjCAccessSpecifier()
706 bool opensScope() const { in opensScope()
716 bool closesScope() const { in closesScope()
726 bool isMemberAccess() const { in isMemberAccess()
732 bool isPointerOrReference() const { in isPointerOrReference()
736 bool isCppAlternativeOperatorKeyword() const { in isCppAlternativeOperatorKeyword()
759 bool isUnaryOperator() const { in isUnaryOperator()
775 bool isBinaryOperator() const { in isBinaryOperator()
780 bool isTrailingComment() const { in isTrailingComment()
787 bool isFunctionLikeKeyword() const { in isFunctionLikeKeyword()
802 bool isLabelString() const { in isLabelString()
838 [[nodiscard]] FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
846 [[nodiscard]] FormatToken *getNextNonComment() const { in getNextNonComment() argument
865 const FormatToken *T = this; in isCppStructuredBinding() argument
882 const FormatToken *getNamespaceToken() const { in getNamespaceToken() argument
895 void copyFrom(const FormatToken &Tok) { *this = Tok; } in copyFrom() argument
900 FormatToken &operator=(const FormatToken &) = default; argument
903 bool startsSequenceInternal(A K1, Ts... Tokens) const { in startsSequenceInternal()
909 template <typename A> bool startsSequenceInternal(A K1) const { in startsSequenceInternal()
915 template <typename A, typename... Ts> bool endsSequenceInternal(A K1) const { in endsSequenceInternal()
939 virtual void precomputeFormattingInfos(const FormatToken *Token); argument