Lines Matching defs:FormatToken

246 struct FormatToken {  struct
247 FormatToken() in FormatToken() argument
269 /// FIXME: Make FormatToken for parsing and AnnotatedToken two different argument
271 std::shared_ptr<TokenRole> Role;
274 SourceRange WhitespaceRange;
278 unsigned HasUnescapedNewline : 1;
281 unsigned IsMultiline : 1;
284 unsigned IsFirst : 1;
290 unsigned MustBreakBefore : 1;
293 unsigned IsUnterminatedLiteral : 1;
296 unsigned CanBreakBefore : 1;
299 unsigned ClosesTemplateDeclaration : 1;
303 unsigned StartsBinaryExpression : 1;
305 unsigned EndsBinaryExpression : 1;
310 unsigned PartOfMultiVariableDeclStmt : 1;
315 unsigned ContinuesLineCommentSection : 1;
320 unsigned Finalized : 1;
323 unsigned ClosesRequiresClause : 1;
326 unsigned EndsCppAttributeGroup : 1;
333 BraceBlockKind getBlockKind() const { in getBlockKind()
336 void setBlockKind(BraceBlockKind BBK) { in setBlockKind()
346 FormatDecision getDecision() const { in getDecision()
349 void setDecision(FormatDecision D) { in setDecision()
359 ParameterPackingKind getPackingKind() const { in getPackingKind()
362 void setPackingKind(ParameterPackingKind K) { in setPackingKind()
369 TokenType Type;
374 TokenType getType() const { return Type; } in getType()
375 void setType(TokenType T) { in setType()
384 void setFinalizedType(TokenType T) { in setFinalizedType()
388 void overwriteFixedType(TokenType T) { in overwriteFixedType()
392 bool isTypeFinalized() const { return TypeIsFinalized; } in isTypeFinalized()
395 prec::Level ForcedPrecedence = prec::Unknown;
401 unsigned NewlinesBefore = 0;
405 unsigned LastNewlineOffset = 0;
410 unsigned ColumnWidth = 0;
414 unsigned LastLineColumnWidth = 0;
417 unsigned SpacesRequiredBefore = 0;
420 unsigned ParameterCount = 0;
424 unsigned BlockParameterCount = 0;
428 tok::TokenKind ParentBracket = tok::unknown;
432 unsigned TotalLength = 0;
436 unsigned OriginalColumn = 0;
440 unsigned UnbreakableTailLength = 0;
445 unsigned BindingStrength = 0;
449 unsigned NestingLevel = 0;
452 unsigned IndentLevel = 0;
455 unsigned SplitPenalty = 0;
462 unsigned LongestObjCSelectorName = 0;
489 FormatToken *NextOperator = nullptr; argument
492 FormatToken *MatchingParen = nullptr; argument
495 FormatToken *Previous = nullptr; argument
498 FormatToken *Next = nullptr; argument
501 bool StartsColumn = false;
504 bool ArrayInitializerLineStart = false;
507 bool IsArrayInitializer = false;
510 bool Optional = false;
516 int8_t BraceCount = 0;
520 SmallVector<AnnotatedLine *, 1> Children;
524 std::optional<MacroExpansion> MacroCtx;
533 bool MacroParent = false;
535 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); } in is()
536 bool is(TokenType TT) const { return getType() == TT; } in is()
537 bool is(const IdentifierInfo *II) const { in is()
540 bool is(tok::PPKeywordKind Kind) const { in is()
544 bool is(BraceBlockKind BBK) const { return getBlockKind() == BBK; } in is()
545 bool is(ParameterPackingKind PPK) const { return getPackingKind() == PPK; } in is()
547 template <typename A, typename B> bool isOneOf(A K1, B K2) const { in isOneOf()
551 bool isOneOf(A K1, B K2, Ts... Ks) const { in isOneOf()
554 template <typename T> bool isNot(T Kind) const { return !is(Kind); } in isNot()
561 bool closesScopeAfterBlock() const { in closesScopeAfterBlock()
572 bool startsSequence(A K1, Ts... Tokens) const { in startsSequence()
583 bool endsSequence(A K1, Ts... Tokens) const { in endsSequence()
587 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); } in isStringLiteral()
589 bool isObjCAtKeyword(tok::ObjCKeywordKind Kind) const { in isObjCAtKeyword()
598 const auto NextNonComment = getNextNonComment();
602 bool canBePointerOrReferenceQualifier() const { in canBePointerOrReferenceQualifier()
614 bool isObjCAccessSpecifier() const { in isObjCAccessSpecifier()
624 bool opensScope() const { in opensScope()
634 bool closesScope() const { in closesScope()
644 bool isMemberAccess() const { in isMemberAccess()
650 bool isUnaryOperator() const { in isUnaryOperator()
666 bool isBinaryOperator() const { in isBinaryOperator()
671 bool isTrailingComment() const { in isTrailingComment()
678 bool isFunctionLikeKeyword() const { in isFunctionLikeKeyword()
702 bool isLabelString() const { in isLabelString()
738 [[nodiscard]] FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
746 [[nodiscard]] const FormatToken *getNextNonComment() const { in getNextNonComment() argument
762 const FormatToken *T = this; in isCppStructuredBinding() argument
779 const FormatToken *getNamespaceToken() const { in getNamespaceToken() argument
792 void copyFrom(const FormatToken &Tok) { *this = Tok; } in copyFrom() argument
797 FormatToken &operator=(const FormatToken &) = default; argument
800 bool startsSequenceInternal(A K1, Ts... Tokens) const { in startsSequenceInternal()
806 template <typename A> bool startsSequenceInternal(A K1) const { in startsSequenceInternal()
812 template <typename A, typename... Ts> bool endsSequenceInternal(A K1) const { in endsSequenceInternal()
836 virtual void precomputeFormattingInfos(const FormatToken *Token); argument