Lines Matching refs:FormatTok
99 static FormatToken FormatTok;
101 FormatTok.Tok.startToken();
102 FormatTok.Tok.setKind(tok::eof);
105 return &FormatTok;
200 pushToken(FormatTok);
218 switch (FormatTok->Tok.getKind()) {
257 FormatToken *Tok = FormatTok;
319 FormatTok = Tokens->setPosition(StoredPosition);
323 assert(FormatTok->Tok.is(tok::l_brace) && "'{' expected");
335 if (!FormatTok->Tok.is(tok::r_brace)) {
346 assert(FormatTok->Tok.is(tok::hash) && "'#' expected");
347 ScopedMacroState MacroState(*Line, Tokens, FormatTok, StructuralError);
350 if (FormatTok->Tok.getIdentifierInfo() == NULL) {
355 switch (FormatTok->Tok.getIdentifierInfo()->getPPKeywordID()) {
390 if ((FormatTok->Tok.isLiteral() &&
391 StringRef(FormatTok->Tok.getLiteralData(), FormatTok->Tok.getLength()) ==
393 FormatTok->Tok.is(tok::kw_false)) {
424 if (FormatTok->Tok.getKind() != tok::identifier) {
429 if (FormatTok->Tok.getKind() == tok::l_paren &&
430 FormatTok->WhitespaceRange.getBegin() ==
431 FormatTok->WhitespaceRange.getEnd()) {
480 assert(!FormatTok->Tok.is(tok::l_brace));
481 switch (FormatTok->Tok.getKind()) {
484 if (FormatTok->Tok.is(tok::l_brace)) {
488 switch (FormatTok->Tok.getObjCKeywordID()) {
515 if (FormatTok->Tok.is(tok::kw_namespace)) {
550 if (FormatTok->Tok.is(tok::string_literal)) {
552 if (FormatTok->Tok.is(tok::l_brace)) {
564 switch (FormatTok->Tok.getKind()) {
567 if (FormatTok->Tok.is(tok::l_brace))
608 StringRef Text = FormatTok->TokenText;
611 if (FormatTok->Tok.is(tok::colon)) {
616 if (FormatTok->Tok.is(tok::l_paren)) {
618 if (FormatTok->HasUnescapedNewline &&
619 tokenCanStartNewLine(FormatTok->Tok)) {
623 } else if (FormatTok->HasUnescapedNewline && Text.size() >= 5 &&
634 if (FormatTok->Tok.is(tok::l_brace)) {
646 if (FormatTok->BlockKind == BK_Unknown)
648 assert(FormatTok->BlockKind != BK_Unknown);
649 if (FormatTok->BlockKind == BK_Block)
664 switch (FormatTok->Tok.getKind()) {
688 switch (FormatTok->Tok.getKind()) {
691 if (FormatTok->Tok.isNot(tok::semi)) {
716 assert(FormatTok->Tok.is(tok::l_paren) && "'(' expected.");
719 switch (FormatTok->Tok.getKind()) {
746 if (FormatTok->Tok.is(tok::l_brace))
757 assert(FormatTok->Tok.is(tok::kw_if) && "'if' expected");
759 if (FormatTok->Tok.is(tok::l_paren))
762 if (FormatTok->Tok.is(tok::l_brace)) {
776 if (FormatTok->Tok.is(tok::kw_else)) {
778 if (FormatTok->Tok.is(tok::l_brace)) {
783 } else if (FormatTok->Tok.is(tok::kw_if)) {
797 assert(FormatTok->Tok.is(tok::kw_namespace) && "'namespace' expected");
799 if (FormatTok->Tok.is(tok::identifier))
801 if (FormatTok->Tok.is(tok::l_brace)) {
812 if (FormatTok->Tok.is(tok::semi))
820 assert((FormatTok->Tok.is(tok::kw_for) || FormatTok->Tok.is(tok::kw_while)) &&
823 if (FormatTok->Tok.is(tok::l_paren))
825 if (FormatTok->Tok.is(tok::l_brace)) {
839 assert(FormatTok->Tok.is(tok::kw_do) && "'do' expected");
841 if (FormatTok->Tok.is(tok::l_brace)) {
853 if (!FormatTok->Tok.is(tok::kw_while)) {
863 if (FormatTok->Tok.isNot(tok::colon))
869 if (CommentsBeforeNextToken.empty() && FormatTok->Tok.is(tok::l_brace)) {
873 if (FormatTok->Tok.is(tok::kw_break)) {
885 assert(FormatTok->Tok.is(tok::kw_case) && "'case' expected");
889 } while (!eof() && !FormatTok->Tok.is(tok::colon));
894 assert(FormatTok->Tok.is(tok::kw_switch) && "'switch' expected");
896 if (FormatTok->Tok.is(tok::l_paren))
898 if (FormatTok->Tok.is(tok::l_brace)) {
914 if (FormatTok->Tok.is(tok::colon))
921 if (FormatTok->Tok.is(tok::identifier) ||
922 FormatTok->Tok.is(tok::kw___attribute) ||
923 FormatTok->Tok.is(tok::kw___declspec)) {
926 if (FormatTok->Tok.is(tok::l_paren)) {
929 if (FormatTok->Tok.is(tok::identifier))
932 if (FormatTok->Tok.is(tok::l_brace)) {
939 switch (FormatTok->Tok.getKind()) {
965 if (FormatTok->Tok.is(tok::identifier) ||
966 FormatTok->Tok.is(tok::kw___attribute) ||
967 FormatTok->Tok.is(tok::kw___declspec)) {
970 if (FormatTok->Tok.is(tok::l_paren)) {
975 while (FormatTok->Tok.is(tok::identifier) ||
976 FormatTok->Tok.is(tok::coloncolon) ||
977 FormatTok->Tok.is(tok::hashhash))
990 if (FormatTok->Tok.is(tok::colon) || FormatTok->Tok.is(tok::less)) {
991 while (!eof() && FormatTok->Tok.isNot(tok::l_brace)) {
992 if (FormatTok->Tok.is(tok::semi))
998 if (FormatTok->Tok.is(tok::l_brace)) {
1011 assert(FormatTok->Tok.is(tok::less) && "'<' expected.");
1014 while (!eof() && FormatTok->Tok.isNot(tok::greater));
1020 if (FormatTok->Tok.isObjCAtKeyword(tok::objc_end)) {
1034 if (FormatTok->Tok.is(tok::colon)) {
1037 } else if (FormatTok->Tok.is(tok::l_paren))
1041 if (FormatTok->Tok.is(tok::less))
1045 if (FormatTok->Tok.is(tok::l_brace))
1059 if (FormatTok->Tok.is(tok::less))
1063 if (FormatTok->Tok.is(tok::semi)) {
1098 bool UnwrappedLineParser::eof() const { return FormatTok->Tok.is(tok::eof); }
1120 flushComments(FormatTok->NewlinesBefore > 0);
1121 pushToken(FormatTok);
1128 FormatTok = Tokens->getNextToken();
1129 while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) &&
1130 (FormatTok->HasUnescapedNewline || FormatTok->IsFirst)) {
1139 flushComments(FormatTok->NewlinesBefore > 0);
1148 if (!FormatTok->Tok.is(tok::comment))
1150 if (FormatTok->NewlinesBefore > 0 || FormatTok->IsFirst) {
1154 pushToken(FormatTok);
1156 CommentsBeforeNextToken.push_back(FormatTok);