Lines Matching defs:is

143   /* A string that is part of a string concatenation. For C#, JavaScript, and  \
144 * Java, it is used for marking whether a string needs parentheses around it \
145 * if it is to be split into parts joined by `+`. For Verilog, whether \
189 /// Determines the semantic type of a syntactic token, e.g. whether "<" is a
214 /// The token is part of a macro argument that was previously formatted as
217 /// The token was expanded from a macro definition, and is not visible as part
263 /// The number of expansions of which this macro is the first entry.
266 /// The number of currently open expansions in \c ExpandedFrom this macro is
307 /// Whether there is at least one unescaped newline before the \c
314 /// Indicates that this is the first token of the file.
323 /// Whether MustBreakBefore is finalized during parsing and must not
327 /// Set to \c true if this token is an unterminated literal.
330 /// \c true if it is allowed to break before this token.
333 /// \c true if this is the ">" of "template<..>".
357 /// \c true if this is the last token within requires clause.
364 /// Contains the kind of block if this token is a brace.
390 /// If this is an opening parenthesis, how are the parameters packed?
407 /// Returns the token's type, e.g. whether "<" is a template opener or
411 // If this token is a macro argument while formatting an unexpanded macro
449 /// This is used to avoid overlapping whitespace replacements when \c Newlines
450 /// is recomputed for a finalized preprocessor branching directive.
454 /// whitespace (relative to \c WhiteSpaceStart). 0 if there is no '\n'.
469 /// Number of parameters, if this is "(", "[" or "<".
473 /// if this is "(", "[" or "<".
476 /// If this is a bracket ("<", "(", "[" or "{"), contains the kind of
485 /// The configured TabWidth is used as tab width.
493 /// The binding strength of a token. This is a combined value of
507 /// If this is the first ObjC selector name in an ObjC method
514 /// If this is the first ObjC selector name in an ObjC method
519 /// The 0-based index of the parameter/argument. For ObjC it is set
533 /// If this is an operator (or "."/"->") in a sequence of operators
537 /// If this is an operator (or "."/"->") in a sequence of operators
541 /// If this is a bracket, this points to the matching one.
580 /// This is deeply baked into the code and disentangling this will require
585 bool is(tok::TokenKind Kind) const { return Tok.is(Kind); }
586 bool is(TokenType TT) const { return getType() == TT; }
587 bool is(const IdentifierInfo *II) const {
590 bool is(tok::PPKeywordKind Kind) const {
594 bool is(BraceBlockKind BBK) const { return getBlockKind() == BBK; }
595 bool is(ParameterPackingKind PPK) const { return getPackingKind() == PPK; }
598 return is(K1) || is(K2);
602 return is(K1) || isOneOf(K2, Ks...);
604 template <typename T> bool isNot(T Kind) const { return !is(Kind); }
607 return is(tok::kw_if) || endsSequence(tok::kw_constexpr, tok::kw_if) ||
653 return NextNonComment && NextNonComment->is(tok::colon);
664 /// Determine whether the token is a simple-type-specifier.
670 return is(tok::at) && Next &&
677 /// Returns whether \p Tok is ([{ or an opening < of a template or in
680 if (is(TT_TemplateString) && TokenText.ends_with("${"))
682 if (is(TT_DictLiteral) && is(tok::less))
687 /// Returns whether \p Tok is )]} or a closing > of a template or in
690 if (is(TT_TemplateString) && TokenText.starts_with("}"))
692 if (is(TT_DictLiteral) && is(tok::greater))
698 /// Returns \c true if this is a "." or "->" accessing a member.
726 // Comma is a binary operator, but does not behave as such wrt. formatting.
731 return is(tok::comment) &&
732 (is(TT_LineComment) || !Next || Next->NewlinesBefore > 0);
735 /// Returns \c true if this is a keyword that can be used
750 /// Returns \c true if this is a string literal that's like a label,
775 /// Token is not empty.
790 while (Tok && Tok->is(tok::comment))
798 while (Tok && Tok->is(tok::comment))
810 /// Returns whether the token is the left square bracket of a C++
820 return T && T->is(tok::kw_auto);
825 if (is(TT_TemplateString) && closesScope())
834 if (is(tok::comment))
854 if (is(tok::comment) && Next)
856 return is(K1) && Next && Next->startsSequenceInternal(Tokens...);
860 if (is(tok::comment) && Next)
862 return is(K1);
866 if (is(tok::comment) && Previous)
868 return is(K1);
873 if (is(tok::comment) && Previous)
875 return is(K1) && Previous && Previous->endsSequenceInternal(Tokens...);
893 /// Assumes that the token having this role is already formatted.
1004 kw_is = &IdentTable.get("is");
1231 // is
1603 /// Returns \c true if \p Tok is a keyword or an identifier.
1610 /// Returns \c true if \p Tok is a true JavaScript identifier, returns
1611 /// \c false if it is a keyword or a pseudo keyword.
1612 /// If \c AcceptIdentifierName is true, returns true not only for keywords,
1671 // #undef KEYWORD is not needed -- it's #undef-ed at the end of
1680 /// Returns \c true if \p Tok is a C# keyword, returns
1681 /// \c false if it is a anything else.
1730 return Tok.is(tok::identifier) &&
1774 /// Returns whether \p Tok is a Verilog preprocessor directive. This is
1803 /// Returns whether \p Tok is a Verilog keyword that opens a block.
1805 // `table` is not included since it needs to be treated specially.
1810 /// Returns whether \p Tok is a Verilog keyword that closes a block.
1822 /// Returns whether \p Tok is a Verilog keyword that opens a module, etc.
1826 if (Tok.is(kw_property)) {
1840 // In Verilog the colon in a default label is optional.
1841 return Tok.is(TT_CaseLabelColon) ||
1842 (Tok.is(tok::kw_default) &&
1847 /// Returns whether \p Tok is a Verilog keyword that starts a
1890 return Tok.is(tok::identifier) &&
1911 return FormatTok.is(tok::comment) && !FormatTok.TokenText.starts_with("/*");
1914 // Checks if \p FormatTok is a line comment that continues the line comment
1915 // \p Previous. The original column of \p MinColumnToken is used to determine
1916 // whether \p FormatTok is indented enough to the right to continue \p Previous.