Lines Matching defs:FormatToken

227 struct FormatToken {  struct
228 FormatToken() in FormatToken() argument
249 /// FIXME: Make FormatToken for parsing and AnnotatedToken two different argument
251 std::shared_ptr<TokenRole> Role;
254 SourceRange WhitespaceRange;
258 unsigned HasUnescapedNewline : 1;
261 unsigned IsMultiline : 1;
264 unsigned IsFirst : 1;
270 unsigned MustBreakBefore : 1;
273 unsigned IsUnterminatedLiteral : 1;
276 unsigned CanBreakBefore : 1;
279 unsigned ClosesTemplateDeclaration : 1;
283 unsigned StartsBinaryExpression : 1;
285 unsigned EndsBinaryExpression : 1;
290 unsigned PartOfMultiVariableDeclStmt : 1;
295 unsigned ContinuesLineCommentSection : 1;
300 unsigned Finalized : 1;
303 unsigned ClosesRequiresClause : 1;
310 BraceBlockKind getBlockKind() const { in getBlockKind()
313 void setBlockKind(BraceBlockKind BBK) { in setBlockKind()
323 FormatDecision getDecision() const { in getDecision()
326 void setDecision(FormatDecision D) { in setDecision()
336 ParameterPackingKind getPackingKind() const { in getPackingKind()
339 void setPackingKind(ParameterPackingKind K) { in setPackingKind()
346 TokenType Type;
351 TokenType getType() const { return Type; } in getType()
352 void setType(TokenType T) { in setType()
361 void setFinalizedType(TokenType T) { in setFinalizedType()
365 void overwriteFixedType(TokenType T) { in overwriteFixedType()
369 bool isTypeFinalized() const { return TypeIsFinalized; } in isTypeFinalized()
375 unsigned NewlinesBefore = 0;
379 unsigned LastNewlineOffset = 0;
384 unsigned ColumnWidth = 0;
388 unsigned LastLineColumnWidth = 0;
391 unsigned SpacesRequiredBefore = 0;
394 unsigned ParameterCount = 0;
398 unsigned BlockParameterCount = 0;
402 tok::TokenKind ParentBracket = tok::unknown;
406 unsigned TotalLength = 0;
410 unsigned OriginalColumn = 0;
414 unsigned UnbreakableTailLength = 0;
419 unsigned BindingStrength = 0;
423 unsigned NestingLevel = 0;
426 unsigned IndentLevel = 0;
429 unsigned SplitPenalty = 0;
436 unsigned LongestObjCSelectorName = 0;
463 FormatToken *NextOperator = nullptr; argument
466 FormatToken *MatchingParen = nullptr; argument
469 FormatToken *Previous = nullptr; argument
472 FormatToken *Next = nullptr; argument
475 bool StartsColumn = false;
478 bool ArrayInitializerLineStart = false;
481 bool IsArrayInitializer = false;
484 bool Optional = false;
490 int8_t BraceCount = 0;
494 SmallVector<AnnotatedLine *, 1> Children;
498 llvm::Optional<MacroExpansion> MacroCtx;
507 bool MacroParent = false;
509 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); } in is()
510 bool is(TokenType TT) const { return getType() == TT; } in is()
511 bool is(const IdentifierInfo *II) const { in is()
514 bool is(tok::PPKeywordKind Kind) const { in is()
518 bool is(BraceBlockKind BBK) const { return getBlockKind() == BBK; } in is()
519 bool is(ParameterPackingKind PPK) const { return getPackingKind() == PPK; } in is()
521 template <typename A, typename B> bool isOneOf(A K1, B K2) const { in isOneOf()
525 bool isOneOf(A K1, B K2, Ts... Ks) const { in isOneOf()
528 template <typename T> bool isNot(T Kind) const { return !is(Kind); } in isNot()
535 bool closesScopeAfterBlock() const { in closesScopeAfterBlock()
546 bool startsSequence(A K1, Ts... Tokens) const { in startsSequence()
557 bool endsSequence(A K1, Ts... Tokens) const { in endsSequence()
561 bool isStringLiteral() const { return tok::isStringLiteral(Tok.getKind()); } in isStringLiteral()
563 bool isObjCAtKeyword(tok::ObjCKeywordKind Kind) const { in isObjCAtKeyword()
572 bool canBePointerOrReferenceQualifier() const { in canBePointerOrReferenceQualifier()
584 bool isObjCAccessSpecifier() const { in isObjCAccessSpecifier()
594 bool opensScope() const { in opensScope()
604 bool closesScope() const { in closesScope()
614 bool isMemberAccess() const { in isMemberAccess()
620 bool isUnaryOperator() const { in isUnaryOperator()
636 bool isBinaryOperator() const { in isBinaryOperator()
641 bool isTrailingComment() const { in isTrailingComment()
648 bool isFunctionLikeKeyword() const { in isFunctionLikeKeyword()
671 bool isLabelString() const { in isLabelString()
705 LLVM_NODISCARD FormatToken *getPreviousNonComment() const { in getPreviousNonComment() argument
713 LLVM_NODISCARD const FormatToken *getNextNonComment() const { in getNextNonComment() argument
729 const FormatToken *T = this; in isCppStructuredBinding() argument
746 const FormatToken *getNamespaceToken() const { in getNamespaceToken() argument
759 void copyFrom(const FormatToken &Tok) { *this = Tok; } in copyFrom() argument
764 FormatToken &operator=(const FormatToken &) = default; argument
767 bool startsSequenceInternal(A K1, Ts... Tokens) const { in startsSequenceInternal()
773 template <typename A> bool startsSequenceInternal(A K1) const { in startsSequenceInternal()
779 template <typename A, typename... Ts> bool endsSequenceInternal(A K1) const { in endsSequenceInternal()
803 virtual void precomputeFormattingInfos(const FormatToken *Token); argument