Lines Matching refs:FormatTok
371 void DebugTokenState(const FormatToken &FormatTok) {
372 const Token &Tok = FormatTok.Tok;
1334 : FormatTok(NULL), GreaterStashed(false), TrailingWhitespace(0), Lex(Lex),
1354 Token Greater = FormatTok->Tok;
1355 FormatTok = new (Allocator.Allocate()) FormatToken;
1356 FormatTok->Tok = Greater;
1358 FormatTok->Tok.getLocation().getLocWithOffset(1);
1359 FormatTok->WhitespaceRange =
1361 FormatTok->TokenText = ">";
1362 FormatTok->CodePointCount = 1;
1364 return FormatTok;
1367 FormatTok = new (Allocator.Allocate()) FormatToken;
1368 readRawToken(*FormatTok);
1370 FormatTok->Tok.getLocation().getLocWithOffset(-TrailingWhitespace);
1372 FormatTok->IsFirst = true;
1376 while (FormatTok->Tok.is(tok::unknown)) {
1377 unsigned Newlines = FormatTok->TokenText.count('\n');
1379 FormatTok->LastNewlineOffset =
1380 WhitespaceLength + FormatTok->TokenText.rfind('\n') + 1;
1381 FormatTok->NewlinesBefore += Newlines;
1382 unsigned EscapedNewlines = FormatTok->TokenText.count("\\\n");
1383 FormatTok->HasUnescapedNewline |= EscapedNewlines != Newlines;
1384 WhitespaceLength += FormatTok->Tok.getLength();
1386 readRawToken(*FormatTok);
1395 while (FormatTok->TokenText.size() > 1 && FormatTok->TokenText[0] == '\\' &&
1396 FormatTok->TokenText[1] == '\n') {
1397 // FIXME: ++FormatTok->NewlinesBefore is missing...
1399 FormatTok->TokenText = FormatTok->TokenText.substr(2);
1403 if (FormatTok->Tok.is(tok::comment)) {
1404 StringRef UntrimmedText = FormatTok->TokenText;
1405 FormatTok->TokenText = FormatTok->TokenText.rtrim();
1406 TrailingWhitespace = UntrimmedText.size() - FormatTok->TokenText.size();
1407 } else if (FormatTok->Tok.is(tok::raw_identifier)) {
1408 IdentifierInfo &Info = IdentTable.get(FormatTok->TokenText);
1409 FormatTok->Tok.setIdentifierInfo(&Info);
1410 FormatTok->Tok.setKind(Info.getTokenID());
1411 } else if (FormatTok->Tok.is(tok::greatergreater)) {
1412 FormatTok->Tok.setKind(tok::greater);
1413 FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
1417 // Now FormatTok is the next non-whitespace token.
1418 FormatTok->CodePointCount =
1419 encoding::getCodePointCount(FormatTok->TokenText, Encoding);
1421 FormatTok->WhitespaceRange = SourceRange(
1423 return FormatTok;
1426 FormatToken *FormatTok;