Lines Matching refs:FormatTok
29 : FormatTok(nullptr), IsFirstToken(true), GreaterStashed(false),
369 Token Tok = FormatTok->Tok;
370 StringRef TokenText = FormatTok->TokenText;
372 unsigned OriginalColumn = FormatTok->OriginalColumn;
373 FormatTok = new (Allocator.Allocate()) FormatToken;
374 FormatTok->Tok = Tok;
376 FormatTok->Tok.getLocation().getLocWithOffset(Tok.getLength() - 1);
377 FormatTok->Tok.setLocation(TokLocation);
378 FormatTok->WhitespaceRange = SourceRange(TokLocation, TokLocation);
379 FormatTok->TokenText = TokenText;
380 FormatTok->ColumnWidth = 1;
381 FormatTok->OriginalColumn = OriginalColumn + 1;
383 return FormatTok;
396 FormatTok = new (Allocator.Allocate()) FormatToken;
397 readRawToken(*FormatTok);
399 FormatTok->Tok.getLocation().getLocWithOffset(-TrailingWhitespace);
400 FormatTok->IsFirst = IsFirstToken;
405 while (FormatTok->Tok.is(tok::unknown)) {
406 StringRef Text = FormatTok->TokenText;
423 ++FormatTok->NewlinesBefore;
424 FormatTok->HasUnescapedNewline = !EscapesNewline(i - 1);
425 FormatTok->LastNewlineOffset = WhitespaceLength + i + 1;
429 FormatTok->LastNewlineOffset = WhitespaceLength + i + 1;
444 FormatTok->Type = TT_ImplicitStringLiteral;
447 FormatTok->Type = TT_ImplicitStringLiteral;
450 if (FormatTok->Type == TT_ImplicitStringLiteral)
454 if (FormatTok->is(TT_ImplicitStringLiteral))
456 WhitespaceLength += FormatTok->Tok.getLength();
458 readRawToken(*FormatTok);
465 while (FormatTok->TokenText.size() > 1 && FormatTok->TokenText[0] == '\\' &&
466 FormatTok->TokenText[1] == '\n') {
467 ++FormatTok->NewlinesBefore;
469 FormatTok->LastNewlineOffset = 2;
471 FormatTok->TokenText = FormatTok->TokenText.substr(2);
474 FormatTok->WhitespaceRange = SourceRange(
477 FormatTok->OriginalColumn = Column;
480 if (FormatTok->Tok.is(tok::comment)) {
482 StringRef UntrimmedText = FormatTok->TokenText;
483 FormatTok->TokenText = FormatTok->TokenText.rtrim(" \t\v\f");
484 TrailingWhitespace = UntrimmedText.size() - FormatTok->TokenText.size();
485 } else if (FormatTok->Tok.is(tok::raw_identifier)) {
486 IdentifierInfo &Info = IdentTable.get(FormatTok->TokenText);
487 FormatTok->Tok.setIdentifierInfo(&Info);
488 FormatTok->Tok.setKind(Info.getTokenID());
490 FormatTok->isOneOf(tok::kw_struct, tok::kw_union, tok::kw_delete,
492 FormatTok->Tok.setKind(tok::identifier);
493 FormatTok->Tok.setIdentifierInfo(nullptr);
495 FormatTok->isOneOf(tok::kw_struct, tok::kw_union,
497 FormatTok->Tok.setKind(tok::identifier);
498 FormatTok->Tok.setIdentifierInfo(nullptr);
500 } else if (FormatTok->Tok.is(tok::greatergreater)) {
501 FormatTok->Tok.setKind(tok::greater);
502 FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
504 } else if (FormatTok->Tok.is(tok::lessless)) {
505 FormatTok->Tok.setKind(tok::less);
506 FormatTok->TokenText = FormatTok->TokenText.substr(0, 1);
510 // Now FormatTok is the next non-whitespace token.
512 StringRef Text = FormatTok->TokenText;
517 FormatTok->ColumnWidth =
519 Column += FormatTok->ColumnWidth;
521 FormatTok->IsMultiline = true;
524 FormatTok->ColumnWidth = encoding::columnWidthWithTabs(
529 FormatTok->LastLineColumnWidth = encoding::columnWidthWithTabs(
531 Column = FormatTok->LastLineColumnWidth;
539 FormatTok->Tok.getIdentifierInfo()) != ForEachMacros.end()) {
540 FormatTok->Type = TT_ForEachMacro;
541 } else if (FormatTok->is(tok::identifier)) {
543 FormatTok->Type = TT_MacroBlockBegin;
545 FormatTok->Type = TT_MacroBlockEnd;
550 return FormatTok;