Lines Matching refs:Line

81   AnnotatingParser(SourceManager &SourceMgr, Lexer &Lex, AnnotatedLine &Line,
83 : SourceMgr(SourceMgr), Lex(Lex), Line(Line), CurrentToken(&Line.First),
266 Line.StartsDefinition = true;
309 if (Tok->Parent == NULL && Line.MustBeDeclaration)
319 Line.First.Type == TT_ObjCMethodSpecifier) {
353 if (Line.MustBeDeclaration && NameFound && !Contexts.back().IsExpression)
354 Line.MightBeFunctionDecl = true;
400 if (Line.First.is(tok::kw_for) &&
506 if (Line.First.Type == TT_ObjCMethodSpecifier) {
587 (Current.is(tok::l_paren) && !Line.MustBeDeclaration &&
770 AnnotatedLine &Line;
781 ExpressionParser(AnnotatedLine &Line) : Current(&Line.First) {}
848 void TokenAnnotator::annotate(AnnotatedLine &Line) {
849 AnnotatingParser Parser(SourceMgr, Lex, Line, Ident_in);
850 Line.Type = Parser.parseLine();
851 if (Line.Type == LT_Invalid)
854 ExpressionParser ExprParser(Line);
857 if (Line.First.Type == TT_ObjCMethodSpecifier)
858 Line.Type = LT_ObjCMethodDecl;
859 else if (Line.First.Type == TT_ObjCDecl)
860 Line.Type = LT_ObjCDecl;
861 else if (Line.First.Type == TT_ObjCProperty)
862 Line.Type = LT_ObjCProperty;
864 Line.First.SpacesRequiredBefore = 1;
865 Line.First.MustBreakBefore = Line.First.FormatTok.MustBreakBefore;
866 Line.First.CanBreakBefore = Line.First.MustBreakBefore;
868 Line.First.TotalLength = Line.First.FormatTok.TokenLength;
871 void TokenAnnotator::calculateFormattingInformation(AnnotatedLine &Line) {
872 if (Line.First.Children.empty())
874 AnnotatedToken *Current = &Line.First.Children[0];
880 spaceRequiredBefore(Line, *Current) ? 1 : 0;
898 Current->MustBreakBefore || canBreakBefore(Line, *Current);
909 20 * Current->BindingStrength + splitPenalty(Line, *Current);
915 printDebugInfo(Line);
919 unsigned TokenAnnotator::splitPenalty(const AnnotatedLine &Line,
925 if (Line.First.is(tok::kw_for) && Right.PartOfMultiVariableDeclStmt)
927 else if (Line.MightBeFunctionDecl && Right.BindingStrength == 1)
945 if (Line.Type == LT_BuilderTypeCall)
954 if (Line.First.is(tok::kw_for) && Left.is(tok::equal))
969 if (Left.is(tok::l_paren) && Line.MightBeFunctionDecl)
995 bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
1006 (Line.Type == LT_ObjCDecl && Style.ObjCSpaceBeforeProtocolList)))
1049 return Line.Type == LT_ObjCDecl ||
1064 bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
1069 if (Line.Type == LT_ObjCMethodDecl) {
1076 if (Line.Type == LT_ObjCProperty &&
1091 return !Line.First.isOneOf(tok::kw_case, tok::kw_default) &&
1118 if (Tok.is(tok::less) && Line.First.is(tok::hash))
1122 return spaceRequiredBetween(Line, *Tok.Parent, Tok);
1125 bool TokenAnnotator::canBreakBefore(const AnnotatedLine &Line,
1151 if (Left.is(tok::equal) && Line.Type == LT_VirtualFunctionDecl)
1187 void TokenAnnotator::printDebugInfo(const AnnotatedLine &Line) {
1189 const AnnotatedToken *Tok = &Line.First;