Lines Matching refs:Line
32 AnnotatingParser(AnnotatedLine &Line, IdentifierInfo &Ident_in)
33 : Line(Line), CurrentToken(Line.First), KeywordVirtualFound(false),
65 Line.First->isNot(tok::kw_template))
263 Line.StartsDefinition = true;
307 if (Tok->Previous == NULL && Line.MustBeDeclaration)
319 Line.First->Type == TT_ObjCMethodSpecifier) {
354 if (Line.MustBeDeclaration && NameFound && !Contexts.back().IsExpression)
355 Line.MightBeFunctionDecl = true;
404 if (Line.First->is(tok::kw_for) &&
433 // they are not split or line-wrapped.
455 // Hashes in the middle of a line can lead to any strange token
511 if (Line.First->Type == TT_ObjCMethodSpecifier) {
593 (Current.is(tok::l_paren) && !Line.MustBeDeclaration &&
594 !Line.InPPDirective &&
621 Line.MustBeDeclaration) {
823 AnnotatedLine &Line;
835 ExpressionParser(AnnotatedLine &Line) : Current(Line.First) {
873 // At the end of the line or when an operator with higher precedence is
932 void TokenAnnotator::annotate(AnnotatedLine &Line) {
933 AnnotatingParser Parser(Line, Ident_in);
934 Line.Type = Parser.parseLine();
935 if (Line.Type == LT_Invalid)
938 ExpressionParser ExprParser(Line);
941 if (Line.First->Type == TT_ObjCMethodSpecifier)
942 Line.Type = LT_ObjCMethodDecl;
943 else if (Line.First->Type == TT_ObjCDecl)
944 Line.Type = LT_ObjCDecl;
945 else if (Line.First->Type == TT_ObjCProperty)
946 Line.Type = LT_ObjCProperty;
948 Line.First->SpacesRequiredBefore = 1;
949 Line.First->CanBreakBefore = Line.First->MustBreakBefore;
952 void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) {
953 Line.First->TotalLength = Line.First->CodePointCount;
954 if (!Line.First->Next)
956 FormatToken *Current = Line.First->Next;
962 spaceRequiredBefore(Line, *Current) ? 1 : 0;
984 Current->MustBreakBefore || canBreakBefore(Line, *Current);
997 20 * Current->BindingStrength + splitPenalty(Line, *Current);
1002 calculateUnbreakableTailLengths(Line);
1004 printDebugInfo(Line);
1008 void TokenAnnotator::calculateUnbreakableTailLengths(AnnotatedLine &Line) {
1010 FormatToken *Current = Line.Last;
1024 unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
1037 if (Line.First->is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt)
1041 else if (Line.MightBeFunctionDecl && Right.BindingStrength == 1)
1069 if (Left.is(tok::r_paren) && Line.Type != LT_ObjCProperty &&
1075 if (Line.First->is(tok::kw_for) && Left.is(tok::equal))
1085 if (Left.is(tok::l_paren) && Line.MightBeFunctionDecl)
1110 bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
1121 (Line.Type == LT_ObjCDecl && Style.ObjCSpaceBeforeProtocolList)))
1172 return Line.Type == LT_ObjCDecl ||
1196 bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
1200 if (Line.Type == LT_ObjCMethodDecl) {
1207 if (Line.Type == LT_ObjCProperty &&
1225 return !Line.First->isOneOf(tok::kw_case, tok::kw_default) &&
1244 if (Tok.is(tok::less) && Line.First->is(tok::hash))
1248 return spaceRequiredBetween(Line, *Tok.Previous, Tok);
1251 bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
1264 if (Left.is(tok::r_paren) && Line.Type == LT_ObjCProperty)
1283 if (Left.is(tok::equal) && Line.Type == LT_VirtualFunctionDecl)
1333 void TokenAnnotator::printDebugInfo(const AnnotatedLine &Line) {
1335 const FormatToken *Tok = Line.First;