for (unsigned i = 0, e = State.Stack.size() - 1; i != e; ++i) {
State.Stack[i].BreakBeforeParameter = true;
}
- const FormatToken *TokenBefore = Current.getPreviousNoneComment();
+ const FormatToken *TokenBefore = Current.getPreviousNonComment();
if (TokenBefore && !TokenBefore->isOneOf(tok::comma, tok::semi) &&
TokenBefore->Type != TT_TemplateCloser &&
TokenBefore->Type != TT_BinaryOperator && !TokenBefore->opensScope())
State.Stack.back().Indent += 4;
// Insert scopes created by fake parenthesis.
- const FormatToken *Previous = Current.getPreviousNoneComment();
+ const FormatToken *Previous = Current.getPreviousNonComment();
// Don't add extra indentation for the first fake parenthesis after
// 'return', assignements or opening <({[. The indentation for these cases
// is special cased.
bool AvoidBinPacking;
if (Current.is(tok::l_brace)) {
NewIndent = Style.IndentWidth + LastSpace;
- const FormatToken *NextNoComment = Current.getNextNoneComment();
+ const FormatToken *NextNoComment = Current.getNextNonComment();
AvoidBinPacking = NextNoComment &&
NextNoComment->Type == TT_DesignatedInitializerPeriod;
} else {
// Adapt level to the next line if this is a comment.
// FIXME: Can/should this be done in the UnwrappedLineParser?
- const AnnotatedLine *NextNoneCommentLine = NULL;
+ const AnnotatedLine *NextNonCommentLine = NULL;
for (unsigned i = AnnotatedLines.size() - 1; i > 0; --i) {
- if (NextNoneCommentLine && AnnotatedLines[i].First->is(tok::comment) &&
+ if (NextNonCommentLine && AnnotatedLines[i].First->is(tok::comment) &&
!AnnotatedLines[i].First->Next)
- AnnotatedLines[i].Level = NextNoneCommentLine->Level;
+ AnnotatedLines[i].Level = NextNonCommentLine->Level;
else
- NextNoneCommentLine =
+ NextNonCommentLine =
AnnotatedLines[i].First->isNot(tok::r_brace) ? &AnnotatedLines[i]
: NULL;
}
FormatToken *Tok = (I + 1)->First;
if (Tok->is(tok::r_brace) && !Tok->MustBreakBefore &&
- (Tok->getNextNoneComment() == NULL ||
- Tok->getNextNoneComment()->is(tok::semi))) {
+ (Tok->getNextNonComment() == NULL ||
+ Tok->getNextNonComment()->is(tok::semi))) {
// We merge empty blocks even if the line exceeds the column limit.
Tok->SpacesRequiredBefore = 0;
Tok->CanBreakBefore = true;
// Last, check that the third line contains a single closing brace.
Tok = (I + 2)->First;
- if (Tok->getNextNoneComment() != NULL || Tok->isNot(tok::r_brace) ||
+ if (Tok->getNextNonComment() != NULL || Tok->isNot(tok::r_brace) ||
Tok->MustBreakBefore)
return;
// '*' has to be a binary operator but determineStarAmpUsage() will
// categorize it as an unary operator, so set the right type here.
if (LookForDecls && CurrentToken->Next) {
- FormatToken *Prev = CurrentToken->getPreviousNoneComment();
+ FormatToken *Prev = CurrentToken->getPreviousNonComment();
if (Prev) {
- FormatToken *PrevPrev = Prev->getPreviousNoneComment();
+ FormatToken *PrevPrev = Prev->getPreviousNonComment();
FormatToken *Next = CurrentToken->Next;
if (PrevPrev && PrevPrev->is(tok::identifier) &&
Prev->isOneOf(tok::star, tok::amp, tok::ampamp) &&
// ')' or ']'), it could be the start of an Objective-C method
// expression, or it could the the start of an Objective-C array literal.
FormatToken *Left = CurrentToken->Previous;
- FormatToken *Parent = Left->getPreviousNoneComment();
+ FormatToken *Parent = Left->getPreviousNonComment();
bool StartsObjCMethodExpr =
Contexts.back().CanBeExpression &&
(!Parent || Parent->isOneOf(tok::colon, tok::l_square, tok::l_paren,
ScopedContextCreator ContextCreator(*this, tok::l_brace, 1);
FormatToken *Left = CurrentToken->Previous;
- FormatToken *Parent = Left->getPreviousNoneComment();
+ FormatToken *Parent = Left->getPreviousNonComment();
bool StartsObjCDictLiteral = Parent && Parent->is(tok::at);
if (StartsObjCDictLiteral) {
Contexts.back().ColonIsObjCDictLiteral = true;
} else if (Current.is(tok::r_paren)) {
FormatToken *LeftOfParens = NULL;
if (Current.MatchingParen)
- LeftOfParens = Current.MatchingParen->getPreviousNoneComment();
+ LeftOfParens = Current.MatchingParen->getPreviousNonComment();
bool IsCast = false;
bool ParensAreEmpty = Current.Previous == Current.MatchingParen;
bool ParensAreType = !Current.Previous ||
break;
}
} else if (Current.is(tok::period)) {
- FormatToken *PreviousNoComment = Current.getPreviousNoneComment();
+ FormatToken *PreviousNoComment = Current.getPreviousNonComment();
if (PreviousNoComment &&
PreviousNoComment->isOneOf(tok::comma, tok::l_brace))
Current.Type = TT_DesignatedInitializerPeriod;
/// \brief Return the type of the given token assuming it is * or &.
TokenType determineStarAmpUsage(const FormatToken &Tok, bool IsExpression) {
- const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+ const FormatToken *PrevToken = Tok.getPreviousNonComment();
if (PrevToken == NULL)
return TT_UnaryOperator;
- const FormatToken *NextToken = Tok.getNextNoneComment();
+ const FormatToken *NextToken = Tok.getNextNonComment();
if (NextToken == NULL)
return TT_Unknown;
}
TokenType determinePlusMinusCaretUsage(const FormatToken &Tok) {
- const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+ const FormatToken *PrevToken = Tok.getPreviousNonComment();
if (PrevToken == NULL || PrevToken->Type == TT_CastRParen)
return TT_UnaryOperator;
/// \brief Determine whether ++/-- are pre- or post-increments/-decrements.
TokenType determineIncrementUsage(const FormatToken &Tok) {
- const FormatToken *PrevToken = Tok.getPreviousNoneComment();
+ const FormatToken *PrevToken = Tok.getPreviousNonComment();
if (PrevToken == NULL || PrevToken->Type == TT_CastRParen)
return TT_UnaryOperator;
if (PrevToken->isOneOf(tok::r_paren, tok::r_square, tok::identifier))
Current->is(tok::string_literal) &&
Current->Previous->isNot(tok::lessless) &&
Current->Previous->Type != TT_InlineASMColon &&
- Current->getNextNoneComment() &&
- Current->getNextNoneComment()->is(tok::string_literal)) {
+ Current->getNextNonComment() &&
+ Current->getNextNonComment()->is(tok::string_literal)) {
Current->MustBreakBefore = true;
} else {
Current->MustBreakBefore = false;
return !Left.isOneOf(tok::l_paren, tok::l_square, tok::at) &&
(Left.isNot(tok::colon) || Left.Type != TT_ObjCMethodExpr);
if (Left.isOneOf(tok::identifier, tok::greater, tok::r_square) &&
- Right.is(tok::l_brace) && Right.getNextNoneComment())
+ Right.is(tok::l_brace) && Right.getNextNonComment())
return false;
if (Left.is(tok::period) || Right.is(tok::period))
return false;
return false;
if (Tok.is(tok::colon))
return !Line.First->isOneOf(tok::kw_case, tok::kw_default) &&
- Tok.getNextNoneComment() != NULL && Tok.Type != TT_ObjCMethodExpr;
+ Tok.getNextNonComment() != NULL && Tok.Type != TT_ObjCMethodExpr;
if (Tok.Previous->Type == TT_UnaryOperator ||
Tok.Previous->Type == TT_CastRParen)
return false;