reference, declarationdefinition
definition → references, declarations, derived classes, virtual overrides
reference to multiple definitions → definitions
unreferenced

References

tools/clang/lib/Format/TokenAnnotator.cpp
 1354     if (!Current.is(TT_Unknown))
 1359       if (Current.is(tok::exclaim)) {
 1360         if (Current.Previous &&
 1361             (Current.Previous->isOneOf(tok::identifier, tok::kw_namespace,
 1364              Current.Previous->Tok.isLiteral())) {
 1365           Current.Type = TT_JsNonNullAssertion;
 1368         if (Current.Next &&
 1369             Current.Next->isOneOf(TT_BinaryOperator, Keywords.kw_as)) {
 1370           Current.Type = TT_JsNonNullAssertion;
 1379     if (Current.is(Keywords.kw_instanceof)) {
 1380       Current.Type = TT_BinaryOperator;
 1381     } else if (isStartOfName(Current) &&
 1382                (!Line.MightBeFunctionDecl || Current.NestingLevel != 0)) {
 1383       Contexts.back().FirstStartOfName = &Current;
 1384       Current.Type = TT_StartOfName;
 1385     } else if (Current.is(tok::semi)) {
 1390     } else if (Current.isOneOf(tok::kw_auto, tok::kw___auto_type)) {
 1392     } else if (Current.is(tok::arrow) &&
 1394       Current.Type = TT_LambdaArrow;
 1395     } else if (Current.is(tok::arrow) && AutoFound && Line.MustBeDeclaration &&
 1396                Current.NestingLevel == 0 &&
 1397                !Current.Previous->is(tok::kw_operator)) {
 1399       Current.Type = TT_TrailingReturnArrow;
 1400     } else if (Current.isOneOf(tok::star, tok::amp, tok::ampamp)) {
 1401       Current.Type = determineStarAmpUsage(Current,
 1401       Current.Type = determineStarAmpUsage(Current,
 1405     } else if (Current.isOneOf(tok::minus, tok::plus, tok::caret)) {
 1406       Current.Type = determinePlusMinusCaretUsage(Current);
 1406       Current.Type = determinePlusMinusCaretUsage(Current);
 1407       if (Current.is(TT_UnaryOperator) && Current.is(tok::caret))
 1407       if (Current.is(TT_UnaryOperator) && Current.is(tok::caret))
 1409     } else if (Current.isOneOf(tok::minusminus, tok::plusplus)) {
 1410       Current.Type = determineIncrementUsage(Current);
 1410       Current.Type = determineIncrementUsage(Current);
 1411     } else if (Current.isOneOf(tok::exclaim, tok::tilde)) {
 1412       Current.Type = TT_UnaryOperator;
 1413     } else if (Current.is(tok::question)) {
 1418         Current.Type = TT_JsTypeOptionalQuestion;
 1420         Current.Type = TT_ConditionalExpr;
 1422     } else if (Current.isBinaryOperator() &&
 1423                (!Current.Previous || Current.Previous->isNot(tok::l_square)) &&
 1423                (!Current.Previous || Current.Previous->isNot(tok::l_square)) &&
 1424                (!Current.is(tok::greater) &&
 1426       Current.Type = TT_BinaryOperator;
 1427     } else if (Current.is(tok::comment)) {
 1428       if (Current.TokenText.startswith("/*")) {
 1429         if (Current.TokenText.endswith("*/"))
 1430           Current.Type = TT_BlockComment;
 1434           Current.Tok.setKind(tok::unknown);
 1436         Current.Type = TT_LineComment;
 1438     } else if (Current.is(tok::r_paren)) {
 1439       if (rParenEndsCast(Current))
 1440         Current.Type = TT_CastRParen;
 1441       if (Current.MatchingParen && Current.Next &&
 1441       if (Current.MatchingParen && Current.Next &&
 1442           !Current.Next->isBinaryOperator() &&
 1443           !Current.Next->isOneOf(tok::semi, tok::colon, tok::l_brace,
 1446         if (FormatToken *AfterParen = Current.MatchingParen->Next) {
 1449             if (FormatToken *BeforeParen = Current.MatchingParen->Previous)
 1455                 Current.Type = TT_FunctionAnnotationRParen;
 1458     } else if (Current.is(tok::at) && Current.Next &&
 1458     } else if (Current.is(tok::at) && Current.Next &&
 1463       switch (Current.Next->Tok.getObjCKeywordID()) {
 1467         Current.Type = TT_ObjCDecl;
 1470         Current.Type = TT_ObjCProperty;
 1475     } else if (Current.is(tok::period)) {
 1476       FormatToken *PreviousNoComment = Current.getPreviousNonComment();
 1479         Current.Type = TT_DesignatedInitializerPeriod;
 1480       else if (Style.Language == FormatStyle::LK_Java && Current.Previous &&
 1481                Current.Previous->isOneOf(TT_JavaAnnotation,
 1483         Current.Type = Current.Previous->Type;
 1483         Current.Type = Current.Previous->Type;
 1485     } else if (canBeObjCSelectorComponent(Current) &&
 1488                Current.Previous && Current.Previous->is(TT_CastRParen) &&
 1488                Current.Previous && Current.Previous->is(TT_CastRParen) &&
 1489                Current.Previous->MatchingParen &&
 1490                Current.Previous->MatchingParen->Previous &&
 1491                Current.Previous->MatchingParen->Previous->is(
 1496       Current.Type = TT_SelectorName;
 1497     } else if (Current.isOneOf(tok::identifier, tok::kw_const,
 1499                Current.Previous &&
 1500                !Current.Previous->isOneOf(tok::equal, tok::at) &&
 1504       Current.Type = TT_TrailingAnnotation;
 1507                Current.Previous) {
 1508       if (Current.Previous->is(tok::at) &&
 1509           Current.isNot(Keywords.kw_interface)) {
 1510         const FormatToken &AtToken = *Current.Previous;
 1513           Current.Type = TT_LeadingJavaAnnotation;
 1515           Current.Type = TT_JavaAnnotation;
 1516       } else if (Current.Previous->is(tok::period) &&
 1517                  Current.Previous->isOneOf(TT_JavaAnnotation,
 1519         Current.Type = Current.Previous->Type;
 1519         Current.Type = Current.Previous->Type;