|
@@ -47,7 +47,7 @@ private:
|
|
if (NonTemplateLess.count(CurrentToken->Previous))
|
|
if (NonTemplateLess.count(CurrentToken->Previous))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- const FormatToken& Previous = *CurrentToken->Previous;
|
|
|
|
|
|
+ const FormatToken &Previous = *CurrentToken->Previous;
|
|
if (Previous.Previous) {
|
|
if (Previous.Previous) {
|
|
if (Previous.Previous->Tok.isLiteral())
|
|
if (Previous.Previous->Tok.isLiteral())
|
|
return false;
|
|
return false;
|
|
@@ -152,11 +152,11 @@ private:
|
|
// export type X = (...);
|
|
// export type X = (...);
|
|
Contexts.back().IsExpression = false;
|
|
Contexts.back().IsExpression = false;
|
|
} else if (Left->Previous &&
|
|
} else if (Left->Previous &&
|
|
- (Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_decltype,
|
|
|
|
- tok::kw_if, tok::kw_while, tok::l_paren,
|
|
|
|
- tok::comma) ||
|
|
|
|
- Left->Previous->endsSequence(tok::kw_constexpr, tok::kw_if) ||
|
|
|
|
- Left->Previous->is(TT_BinaryOperator))) {
|
|
|
|
|
|
+ (Left->Previous->isOneOf(tok::kw_static_assert, tok::kw_decltype,
|
|
|
|
+ tok::kw_if, tok::kw_while, tok::l_paren,
|
|
|
|
+ tok::comma) ||
|
|
|
|
+ Left->Previous->endsSequence(tok::kw_constexpr, tok::kw_if) ||
|
|
|
|
+ Left->Previous->is(TT_BinaryOperator))) {
|
|
// static_assert, if and while usually contain expressions.
|
|
// static_assert, if and while usually contain expressions.
|
|
Contexts.back().IsExpression = true;
|
|
Contexts.back().IsExpression = true;
|
|
} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous &&
|
|
} else if (Style.Language == FormatStyle::LK_JavaScript && Left->Previous &&
|
|
@@ -325,8 +325,7 @@ private:
|
|
// In C++, this can happen either in array of templates (foo<int>[10])
|
|
// In C++, this can happen either in array of templates (foo<int>[10])
|
|
// or when array is a nested template type (unique_ptr<type1<type2>[]>).
|
|
// or when array is a nested template type (unique_ptr<type1<type2>[]>).
|
|
bool CppArrayTemplates =
|
|
bool CppArrayTemplates =
|
|
- Style.isCpp() && Parent &&
|
|
|
|
- Parent->is(TT_TemplateCloser) &&
|
|
|
|
|
|
+ Style.isCpp() && Parent && Parent->is(TT_TemplateCloser) &&
|
|
(Contexts.back().CanBeExpression || Contexts.back().IsExpression ||
|
|
(Contexts.back().CanBeExpression || Contexts.back().IsExpression ||
|
|
Contexts.back().InTemplateArgument);
|
|
Contexts.back().InTemplateArgument);
|
|
|
|
|
|
@@ -607,7 +606,8 @@ private:
|
|
break;
|
|
break;
|
|
case tok::kw_if:
|
|
case tok::kw_if:
|
|
case tok::kw_while:
|
|
case tok::kw_while:
|
|
- if (Tok->is(tok::kw_if) && CurrentToken && CurrentToken->is(tok::kw_constexpr))
|
|
|
|
|
|
+ if (Tok->is(tok::kw_if) && CurrentToken &&
|
|
|
|
+ CurrentToken->is(tok::kw_constexpr))
|
|
next();
|
|
next();
|
|
if (CurrentToken && CurrentToken->is(tok::l_paren)) {
|
|
if (CurrentToken && CurrentToken->is(tok::l_paren)) {
|
|
next();
|
|
next();
|
|
@@ -633,8 +633,7 @@ private:
|
|
// marks the first l_paren as a OverloadedOperatorLParen. Here, we make
|
|
// marks the first l_paren as a OverloadedOperatorLParen. Here, we make
|
|
// the first two parens OverloadedOperators and the second l_paren an
|
|
// the first two parens OverloadedOperators and the second l_paren an
|
|
// OverloadedOperatorLParen.
|
|
// OverloadedOperatorLParen.
|
|
- if (Tok->Previous &&
|
|
|
|
- Tok->Previous->is(tok::r_paren) &&
|
|
|
|
|
|
+ if (Tok->Previous && Tok->Previous->is(tok::r_paren) &&
|
|
Tok->Previous->MatchingParen &&
|
|
Tok->Previous->MatchingParen &&
|
|
Tok->Previous->MatchingParen->is(TT_OverloadedOperatorLParen)) {
|
|
Tok->Previous->MatchingParen->is(TT_OverloadedOperatorLParen)) {
|
|
Tok->Previous->Type = TT_OverloadedOperator;
|
|
Tok->Previous->Type = TT_OverloadedOperator;
|
|
@@ -657,7 +656,7 @@ private:
|
|
break;
|
|
break;
|
|
case tok::l_brace:
|
|
case tok::l_brace:
|
|
if (Style.Language == FormatStyle::LK_TextProto) {
|
|
if (Style.Language == FormatStyle::LK_TextProto) {
|
|
- FormatToken *Previous =Tok->getPreviousNonComment();
|
|
|
|
|
|
+ FormatToken *Previous = Tok->getPreviousNonComment();
|
|
if (Previous && Previous->Type != TT_DictLiteral)
|
|
if (Previous && Previous->Type != TT_DictLiteral)
|
|
Previous->Type = TT_SelectorName;
|
|
Previous->Type = TT_SelectorName;
|
|
}
|
|
}
|
|
@@ -754,8 +753,8 @@ private:
|
|
|
|
|
|
void parseIncludeDirective() {
|
|
void parseIncludeDirective() {
|
|
if (CurrentToken && CurrentToken->is(tok::less)) {
|
|
if (CurrentToken && CurrentToken->is(tok::less)) {
|
|
- next();
|
|
|
|
- while (CurrentToken) {
|
|
|
|
|
|
+ next();
|
|
|
|
+ while (CurrentToken) {
|
|
// Mark tokens up to the trailing line comments as implicit string
|
|
// Mark tokens up to the trailing line comments as implicit string
|
|
// literals.
|
|
// literals.
|
|
if (CurrentToken->isNot(tok::comment) &&
|
|
if (CurrentToken->isNot(tok::comment) &&
|
|
@@ -795,9 +794,9 @@ private:
|
|
void parseHasInclude() {
|
|
void parseHasInclude() {
|
|
if (!CurrentToken || !CurrentToken->is(tok::l_paren))
|
|
if (!CurrentToken || !CurrentToken->is(tok::l_paren))
|
|
return;
|
|
return;
|
|
- next(); // '('
|
|
|
|
|
|
+ next(); // '('
|
|
parseIncludeDirective();
|
|
parseIncludeDirective();
|
|
- next(); // ')'
|
|
|
|
|
|
+ next(); // ')'
|
|
}
|
|
}
|
|
|
|
|
|
LineType parsePreprocessorDirective() {
|
|
LineType parsePreprocessorDirective() {
|
|
@@ -856,7 +855,7 @@ private:
|
|
if (Tok->is(tok::l_paren))
|
|
if (Tok->is(tok::l_paren))
|
|
parseParens();
|
|
parseParens();
|
|
else if (Tok->isOneOf(Keywords.kw___has_include,
|
|
else if (Tok->isOneOf(Keywords.kw___has_include,
|
|
- Keywords.kw___has_include_next))
|
|
|
|
|
|
+ Keywords.kw___has_include_next))
|
|
parseHasInclude();
|
|
parseHasInclude();
|
|
}
|
|
}
|
|
return Type;
|
|
return Type;
|
|
@@ -947,10 +946,11 @@ private:
|
|
// FIXME: Closure-library specific stuff should not be hard-coded but be
|
|
// FIXME: Closure-library specific stuff should not be hard-coded but be
|
|
// configurable.
|
|
// configurable.
|
|
return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
|
|
return Tok.TokenText == "goog" && Tok.Next && Tok.Next->is(tok::period) &&
|
|
- Tok.Next->Next && (Tok.Next->Next->TokenText == "module" ||
|
|
|
|
- Tok.Next->Next->TokenText == "provide" ||
|
|
|
|
- Tok.Next->Next->TokenText == "require" ||
|
|
|
|
- Tok.Next->Next->TokenText == "forwardDeclare") &&
|
|
|
|
|
|
+ Tok.Next->Next &&
|
|
|
|
+ (Tok.Next->Next->TokenText == "module" ||
|
|
|
|
+ Tok.Next->Next->TokenText == "provide" ||
|
|
|
|
+ Tok.Next->Next->TokenText == "require" ||
|
|
|
|
+ Tok.Next->Next->TokenText == "forwardDeclare") &&
|
|
Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
|
|
Tok.Next->Next->Next && Tok.Next->Next->Next->is(tok::l_paren);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1067,8 +1067,7 @@ private:
|
|
Current.Previous->is(TT_CtorInitializerColon)) {
|
|
Current.Previous->is(TT_CtorInitializerColon)) {
|
|
Contexts.back().IsExpression = true;
|
|
Contexts.back().IsExpression = true;
|
|
Contexts.back().InCtorInitializer = true;
|
|
Contexts.back().InCtorInitializer = true;
|
|
- } else if (Current.Previous &&
|
|
|
|
- Current.Previous->is(TT_InheritanceColon)) {
|
|
|
|
|
|
+ } else if (Current.Previous && Current.Previous->is(TT_InheritanceColon)) {
|
|
Contexts.back().InInheritanceList = true;
|
|
Contexts.back().InInheritanceList = true;
|
|
} else if (Current.isOneOf(tok::r_paren, tok::greater, tok::comma)) {
|
|
} else if (Current.isOneOf(tok::r_paren, tok::greater, tok::comma)) {
|
|
for (FormatToken *Previous = Current.Previous;
|
|
for (FormatToken *Previous = Current.Previous;
|
|
@@ -1131,10 +1130,10 @@ private:
|
|
Current.NestingLevel == 0) {
|
|
Current.NestingLevel == 0) {
|
|
Current.Type = TT_TrailingReturnArrow;
|
|
Current.Type = TT_TrailingReturnArrow;
|
|
} else if (Current.isOneOf(tok::star, tok::amp, tok::ampamp)) {
|
|
} else if (Current.isOneOf(tok::star, tok::amp, tok::ampamp)) {
|
|
- Current.Type =
|
|
|
|
- determineStarAmpUsage(Current, Contexts.back().CanBeExpression &&
|
|
|
|
- Contexts.back().IsExpression,
|
|
|
|
- Contexts.back().InTemplateArgument);
|
|
|
|
|
|
+ Current.Type = determineStarAmpUsage(Current,
|
|
|
|
+ Contexts.back().CanBeExpression &&
|
|
|
|
+ Contexts.back().IsExpression,
|
|
|
|
+ Contexts.back().InTemplateArgument);
|
|
} else if (Current.isOneOf(tok::minus, tok::plus, tok::caret)) {
|
|
} else if (Current.isOneOf(tok::minus, tok::plus, tok::caret)) {
|
|
Current.Type = determinePlusMinusCaretUsage(Current);
|
|
Current.Type = determinePlusMinusCaretUsage(Current);
|
|
if (Current.is(TT_UnaryOperator) && Current.is(tok::caret))
|
|
if (Current.is(TT_UnaryOperator) && Current.is(tok::caret))
|
|
@@ -1742,7 +1741,7 @@ void TokenAnnotator::setCommentLineLevels(
|
|
|
|
|
|
static unsigned maxNestingDepth(const AnnotatedLine &Line) {
|
|
static unsigned maxNestingDepth(const AnnotatedLine &Line) {
|
|
unsigned Result = 0;
|
|
unsigned Result = 0;
|
|
- for (const auto* Tok = Line.First; Tok != nullptr; Tok = Tok->Next)
|
|
|
|
|
|
+ for (const auto *Tok = Line.First; Tok != nullptr; Tok = Tok->Next)
|
|
Result = std::max(Result, Tok->NestingLevel);
|
|
Result = std::max(Result, Tok->NestingLevel);
|
|
return Result;
|
|
return Result;
|
|
}
|
|
}
|
|
@@ -1784,7 +1783,7 @@ void TokenAnnotator::annotate(AnnotatedLine &Line) {
|
|
// function declaration.
|
|
// function declaration.
|
|
static bool isFunctionDeclarationName(const FormatToken &Current,
|
|
static bool isFunctionDeclarationName(const FormatToken &Current,
|
|
const AnnotatedLine &Line) {
|
|
const AnnotatedLine &Line) {
|
|
- auto skipOperatorName = [](const FormatToken* Next) -> const FormatToken* {
|
|
|
|
|
|
+ auto skipOperatorName = [](const FormatToken *Next) -> const FormatToken * {
|
|
for (; Next; Next = Next->Next) {
|
|
for (; Next; Next = Next->Next) {
|
|
if (Next->is(TT_OverloadedOperatorLParen))
|
|
if (Next->is(TT_OverloadedOperatorLParen))
|
|
return Next;
|
|
return Next;
|
|
@@ -1792,8 +1791,8 @@ static bool isFunctionDeclarationName(const FormatToken &Current,
|
|
continue;
|
|
continue;
|
|
if (Next->isOneOf(tok::kw_new, tok::kw_delete)) {
|
|
if (Next->isOneOf(tok::kw_new, tok::kw_delete)) {
|
|
// For 'new[]' and 'delete[]'.
|
|
// For 'new[]' and 'delete[]'.
|
|
- if (Next->Next && Next->Next->is(tok::l_square) &&
|
|
|
|
- Next->Next->Next && Next->Next->Next->is(tok::r_square))
|
|
|
|
|
|
+ if (Next->Next && Next->Next->is(tok::l_square) && Next->Next->Next &&
|
|
|
|
+ Next->Next->Next->is(tok::r_square))
|
|
Next = Next->Next->Next;
|
|
Next = Next->Next->Next;
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@@ -2072,7 +2071,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|
if (Left.is(tok::comment))
|
|
if (Left.is(tok::comment))
|
|
return 1000;
|
|
return 1000;
|
|
|
|
|
|
- if (Left.isOneOf(TT_RangeBasedForLoopColon, TT_InheritanceColon, TT_CtorInitializerColon))
|
|
|
|
|
|
+ if (Left.isOneOf(TT_RangeBasedForLoopColon, TT_InheritanceColon,
|
|
|
|
+ TT_CtorInitializerColon))
|
|
return 2;
|
|
return 2;
|
|
|
|
|
|
if (Right.isMemberAccess()) {
|
|
if (Right.isMemberAccess()) {
|
|
@@ -2130,8 +2130,8 @@ unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
|
|
Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign)
|
|
Style.AlignAfterOpenBracket != FormatStyle::BAS_DontAlign)
|
|
return 100;
|
|
return 100;
|
|
if (Left.is(tok::l_paren) && Left.Previous &&
|
|
if (Left.is(tok::l_paren) && Left.Previous &&
|
|
- (Left.Previous->isOneOf(tok::kw_if, tok::kw_for)
|
|
|
|
- || Left.Previous->endsSequence(tok::kw_constexpr, tok::kw_if)))
|
|
|
|
|
|
+ (Left.Previous->isOneOf(tok::kw_if, tok::kw_for) ||
|
|
|
|
+ Left.Previous->endsSequence(tok::kw_constexpr, tok::kw_if)))
|
|
return 1000;
|
|
return 1000;
|
|
if (Left.is(tok::equal) && InFunctionDecl)
|
|
if (Left.is(tok::equal) && InFunctionDecl)
|
|
return 110;
|
|
return 110;
|
|
@@ -2201,8 +2201,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
|
|
: Style.SpacesInParentheses;
|
|
: Style.SpacesInParentheses;
|
|
if (Right.isOneOf(tok::semi, tok::comma))
|
|
if (Right.isOneOf(tok::semi, tok::comma))
|
|
return false;
|
|
return false;
|
|
- if (Right.is(tok::less) &&
|
|
|
|
- Line.Type == LT_ObjCDecl && Style.ObjCSpaceBeforeProtocolList)
|
|
|
|
|
|
+ if (Right.is(tok::less) && Line.Type == LT_ObjCDecl &&
|
|
|
|
+ Style.ObjCSpaceBeforeProtocolList)
|
|
return true;
|
|
return true;
|
|
if (Right.is(tok::less) && Left.is(tok::kw_template))
|
|
if (Right.is(tok::less) && Left.is(tok::kw_template))
|
|
return Style.SpaceAfterTemplateKeyword;
|
|
return Style.SpaceAfterTemplateKeyword;
|
|
@@ -2351,8 +2351,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
|
|
if (Left.is(TT_JsFatArrow))
|
|
if (Left.is(TT_JsFatArrow))
|
|
return true;
|
|
return true;
|
|
// for await ( ...
|
|
// for await ( ...
|
|
- if (Right.is(tok::l_paren) && Left.is(Keywords.kw_await) &&
|
|
|
|
- Left.Previous && Left.Previous->is(tok::kw_for))
|
|
|
|
|
|
+ if (Right.is(tok::l_paren) && Left.is(Keywords.kw_await) && Left.Previous &&
|
|
|
|
+ Left.Previous->is(tok::kw_for))
|
|
return true;
|
|
return true;
|
|
if (Left.is(Keywords.kw_async) && Right.is(tok::l_paren) &&
|
|
if (Left.is(Keywords.kw_async) && Right.is(tok::l_paren) &&
|
|
Right.MatchingParen) {
|
|
Right.MatchingParen) {
|
|
@@ -2509,7 +2509,8 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
|
|
return (Left.is(TT_TemplateOpener) &&
|
|
return (Left.is(TT_TemplateOpener) &&
|
|
Style.Standard == FormatStyle::LS_Cpp03) ||
|
|
Style.Standard == FormatStyle::LS_Cpp03) ||
|
|
!(Left.isOneOf(tok::l_paren, tok::r_paren, tok::l_square,
|
|
!(Left.isOneOf(tok::l_paren, tok::r_paren, tok::l_square,
|
|
- tok::kw___super, TT_TemplateCloser, TT_TemplateOpener));
|
|
|
|
|
|
+ tok::kw___super, TT_TemplateCloser,
|
|
|
|
+ TT_TemplateOpener));
|
|
if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser)))
|
|
if ((Left.is(TT_TemplateOpener)) != (Right.is(TT_TemplateCloser)))
|
|
return Style.SpacesInAngles;
|
|
return Style.SpacesInAngles;
|
|
if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) ||
|
|
if ((Right.is(TT_BinaryOperator) && !Left.is(tok::l_paren)) ||
|
|
@@ -2634,19 +2635,16 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
|
|
!Style.ConstructorInitializerAllOnOneLineOrOnePerLine)
|
|
!Style.ConstructorInitializerAllOnOneLineOrOnePerLine)
|
|
return true;
|
|
return true;
|
|
// Break only if we have multiple inheritance.
|
|
// Break only if we have multiple inheritance.
|
|
- if (Style.BreakBeforeInheritanceComma &&
|
|
|
|
- Right.is(TT_InheritanceComma))
|
|
|
|
- return true;
|
|
|
|
|
|
+ if (Style.BreakBeforeInheritanceComma && Right.is(TT_InheritanceComma))
|
|
|
|
+ return true;
|
|
if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\""))
|
|
if (Right.is(tok::string_literal) && Right.TokenText.startswith("R\""))
|
|
// Raw string literals are special wrt. line breaks. The author has made a
|
|
// Raw string literals are special wrt. line breaks. The author has made a
|
|
// deliberate choice and might have aligned the contents of the string
|
|
// deliberate choice and might have aligned the contents of the string
|
|
// literal accordingly. Thus, we try keep existing line breaks.
|
|
// literal accordingly. Thus, we try keep existing line breaks.
|
|
return Right.NewlinesBefore > 0;
|
|
return Right.NewlinesBefore > 0;
|
|
if ((Right.Previous->is(tok::l_brace) ||
|
|
if ((Right.Previous->is(tok::l_brace) ||
|
|
- (Right.Previous->is(tok::less) &&
|
|
|
|
- Right.Previous->Previous &&
|
|
|
|
- Right.Previous->Previous->is(tok::equal))
|
|
|
|
- ) &&
|
|
|
|
|
|
+ (Right.Previous->is(tok::less) && Right.Previous->Previous &&
|
|
|
|
+ Right.Previous->Previous->is(tok::equal))) &&
|
|
Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) {
|
|
Right.NestingLevel == 1 && Style.Language == FormatStyle::LK_Proto) {
|
|
// Don't put enums or option definitions onto single lines in protocol
|
|
// Don't put enums or option definitions onto single lines in protocol
|
|
// buffers.
|
|
// buffers.
|
|
@@ -2656,7 +2654,8 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine &Line,
|
|
return Right.HasUnescapedNewline;
|
|
return Right.HasUnescapedNewline;
|
|
if (isAllmanBrace(Left) || isAllmanBrace(Right))
|
|
if (isAllmanBrace(Left) || isAllmanBrace(Right))
|
|
return (Line.startsWith(tok::kw_enum) && Style.BraceWrapping.AfterEnum) ||
|
|
return (Line.startsWith(tok::kw_enum) && Style.BraceWrapping.AfterEnum) ||
|
|
- (Line.startsWith(tok::kw_typedef, tok::kw_enum) && Style.BraceWrapping.AfterEnum) ||
|
|
|
|
|
|
+ (Line.startsWith(tok::kw_typedef, tok::kw_enum) &&
|
|
|
|
+ Style.BraceWrapping.AfterEnum) ||
|
|
(Line.startsWith(tok::kw_class) && Style.BraceWrapping.AfterClass) ||
|
|
(Line.startsWith(tok::kw_class) && Style.BraceWrapping.AfterClass) ||
|
|
(Line.startsWith(tok::kw_struct) && Style.BraceWrapping.AfterStruct);
|
|
(Line.startsWith(tok::kw_struct) && Style.BraceWrapping.AfterStruct);
|
|
if (Left.is(TT_ObjCBlockLBrace) && !Style.AllowShortBlocksOnASingleLine)
|
|
if (Left.is(TT_ObjCBlockLBrace) && !Style.AllowShortBlocksOnASingleLine)
|
|
@@ -2750,8 +2749,7 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
|
|
// list.
|
|
// list.
|
|
return Left.BlockKind == BK_BracedInit ||
|
|
return Left.BlockKind == BK_BracedInit ||
|
|
(Left.is(TT_CtorInitializerColon) &&
|
|
(Left.is(TT_CtorInitializerColon) &&
|
|
- Style.BreakConstructorInitializers ==
|
|
|
|
- FormatStyle::BCIS_AfterColon);
|
|
|
|
|
|
+ Style.BreakConstructorInitializers == FormatStyle::BCIS_AfterColon);
|
|
if (Left.is(tok::question) && Right.is(tok::colon))
|
|
if (Left.is(tok::question) && Right.is(tok::colon))
|
|
return false;
|
|
return false;
|
|
if (Right.is(TT_ConditionalExpr) || Right.is(tok::question))
|
|
if (Right.is(TT_ConditionalExpr) || Right.is(tok::question))
|
|
@@ -2876,10 +2874,9 @@ void TokenAnnotator::printDebugInfo(const AnnotatedLine &Line) {
|
|
<< " T=" << getTokenTypeName(Tok->Type)
|
|
<< " T=" << getTokenTypeName(Tok->Type)
|
|
<< " S=" << Tok->SpacesRequiredBefore
|
|
<< " S=" << Tok->SpacesRequiredBefore
|
|
<< " B=" << Tok->BlockParameterCount
|
|
<< " B=" << Tok->BlockParameterCount
|
|
- << " BK=" << Tok->BlockKind
|
|
|
|
- << " P=" << Tok->SplitPenalty << " Name=" << Tok->Tok.getName()
|
|
|
|
- << " L=" << Tok->TotalLength << " PPK=" << Tok->PackingKind
|
|
|
|
- << " FakeLParens=";
|
|
|
|
|
|
+ << " BK=" << Tok->BlockKind << " P=" << Tok->SplitPenalty
|
|
|
|
+ << " Name=" << Tok->Tok.getName() << " L=" << Tok->TotalLength
|
|
|
|
+ << " PPK=" << Tok->PackingKind << " FakeLParens=";
|
|
for (unsigned i = 0, e = Tok->FakeLParens.size(); i != e; ++i)
|
|
for (unsigned i = 0, e = Tok->FakeLParens.size(); i != e; ++i)
|
|
llvm::errs() << Tok->FakeLParens[i] << "/";
|
|
llvm::errs() << Tok->FakeLParens[i] << "/";
|
|
llvm::errs() << " FakeRParens=" << Tok->FakeRParens;
|
|
llvm::errs() << " FakeRParens=" << Tok->FakeRParens;
|