Lines Matching refs:Line

69   ScopedDeclarationState(UnwrappedLine &Line, llvm::BitVector &Stack,  in ScopedDeclarationState()  argument
71 : Line(Line), Stack(Stack) { in ScopedDeclarationState()
72 Line.MustBeDeclaration = MustBeDeclaration; in ScopedDeclarationState()
78 Line.MustBeDeclaration = Stack.back(); in ~ScopedDeclarationState()
80 Line.MustBeDeclaration = true; in ~ScopedDeclarationState()
84 UnwrappedLine &Line; member in clang::format::__anond198c64d0111::ScopedDeclarationState
109 ScopedMacroState(UnwrappedLine &Line, FormatTokenSource *&TokenSource, in ScopedMacroState() argument
111 : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken), in ScopedMacroState()
112 PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource), in ScopedMacroState()
117 Line.Level = 0; in ScopedMacroState()
118 Line.InPPDirective = true; in ScopedMacroState()
124 Line.InPPDirective = false; in ~ScopedMacroState()
125 Line.Level = PreviousLineLevel; in ~ScopedMacroState()
174 UnwrappedLine &Line; member in clang::format::__anond198c64d0111::ScopedMacroState
193 else if (!Parser.Line->Tokens.empty()) in ScopedLineState()
194 Parser.CurrentLines = &Parser.Line->Tokens.back().Children; in ScopedLineState()
195 PreBlockLine = std::move(Parser.Line); in ScopedLineState()
196 Parser.Line = std::make_unique<UnwrappedLine>(); in ScopedLineState()
197 Parser.Line->Level = PreBlockLine->Level; in ScopedLineState()
198 Parser.Line->InPPDirective = PreBlockLine->InPPDirective; in ScopedLineState()
202 if (!Parser.Line->Tokens.empty()) in ~ScopedLineState()
204 assert(Parser.Line->Tokens.empty()); in ~ScopedLineState()
205 Parser.Line = std::move(PreBlockLine); in ~ScopedLineState()
321 : Line(new UnwrappedLine), MustBreakBeforeNextToken(false), in UnwrappedLineParser()
336 Line.reset(new UnwrappedLine); in reset()
345 Line->FirstStartColumn = FirstStartColumn; in reset()
350 Line->FirstStartColumn = FirstStartColumn; in parse()
363 for (auto &Line : Lines) in parse() local
364 if (Line.InPPDirective && Line.Level > 0) in parse()
365 --Line.Level; in parse()
372 for (const UnwrappedLine &Line : Lines) in parse() local
373 Callback.consumeUnwrappedLine(Line); in parse()
393 bool MustBeDeclaration = !Line->InPPDirective && !Style.isJavaScript(); in parseFile()
394 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseFile()
542 if (!Style.RemoveBracesLLVM || Line->InPPDirective || in parseLevel()
579 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseLevel()
586 (Line->InPPDirective && Line->Level == 1))) { in parseLevel()
587 ++Line->Level; in parseLevel()
665 ScopedMacroState MacroState(*Line, Tokens, NextTok); in calculateBraceTypes()
773 hash_combine(h, i.Line); in computePPHash()
805 AnnotatedLine Line(ParsedLine); in mightFitOnOneLine() local
806 assert(Line.Last == LastToken); in mightFitOnOneLine()
809 Annotator.annotate(Line); in mightFitOnOneLine()
810 Annotator.calculateFormattingInformation(Line); in mightFitOnOneLine()
826 return Line.Level * Style.IndentWidth + Length <= ColumnLimit; in mightFitOnOneLine()
854 ++Line->Level; in parseBlock()
858 const unsigned InitialLevel = Line->Level; in parseBlock()
863 if (Line->Level > 300) in parseBlock()
881 --Line->Level; in parseBlock()
883 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseBlock()
886 Line->Level += AddLevels; in parseBlock()
897 Line->Level = InitialLevel; in parseBlock()
961 Line->Level = InitialLevel; in parseBlock()
964 Line->MatchingOpeningBlockLineIndex = OpeningLineIndex; in parseBlock()
975 static bool isGoogScope(const UnwrappedLine &Line) { in isGoogScope() argument
978 if (Line.Tokens.size() < 4) in isGoogScope()
980 auto I = Line.Tokens.begin(); in isGoogScope()
993 static bool isIIFE(const UnwrappedLine &Line, in isIIFE() argument
999 if (Line.Tokens.size() < 3) in isIIFE()
1001 auto I = Line.Tokens.begin(); in isIIFE()
1041 (isGoogScope(*Line) || isIIFE(*Line, Keywords))); in parseChildBlock()
1043 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseChildBlock()
1045 Line->Level += SkipIndent ? 0 : 1; in parseChildBlock()
1048 Line->Level -= SkipIndent ? 0 : 1; in parseChildBlock()
1055 ScopedMacroState MacroState(*Line, Tokens, FormatTok); in parsePPDirective()
1093 size_t Line = CurrentLines->size(); in conditionalCompilationCondition() local
1095 Line += Lines.size(); in conditionalCompilationCondition()
1099 PPStack.push_back({PP_Unreachable, Line}); in conditionalCompilationCondition()
1101 PPStack.push_back({PP_Conditional, Line}); in conditionalCompilationCondition()
1157 for (auto &Line : Lines) { in parsePPIf() local
1158 if (!Line.Tokens.front().Tok->is(tok::comment)) { in parsePPIf()
1212 for (auto &Line : Lines) { in parsePPDefine() local
1213 if (!Line.Tokens.front().Tok->isOneOf(tok::comment, tok::hash)) { in parsePPDefine()
1233 Line->Level += PPBranchLevel + 1; in parsePPDefine()
1235 ++Line->Level; in parsePPDefine()
1250 Line->Level += PPBranchLevel + 1; in parsePPUnknown()
1426 bool HasAt = llvm::any_of(Line->Tokens, [](UnwrappedLineNode &LineNode) { in readTokenWithJavaScriptASI()
1492 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1503 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1510 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1519 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1526 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1538 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1547 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1818 Line->Tokens.front().Tok->is(Keywords.kw_synchronized)) { in parseStructuralElement()
1828 if (!Line->InPPDirective) in parseStructuralElement()
1838 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
1850 Line->MustBeDeclaration) { in parseStructuralElement()
1864 size_t TokenCount = Line->Tokens.size(); in parseStructuralElement()
1866 (TokenCount > 1 || (TokenCount == 1 && !Line->Tokens.front().Tok->is( in parseStructuralElement()
1914 auto I = Line->Tokens.begin(), E = Line->Tokens.end(); in parseStructuralElement()
1922 if (FormatTok->is(tok::colon) && !Line->MustBeDeclaration) { in parseStructuralElement()
1923 Line->Tokens.begin()->Tok->MustBreakBefore = true; in parseStructuralElement()
1979 if (Style.isJavaScript() && Line->MustBeDeclaration) { in parseStructuralElement()
2051 ++Line->Level; in tryToParsePropertyAccessor()
2054 --Line->Level; in tryToParsePropertyAccessor()
2058 ++Line->Level; in tryToParsePropertyAccessor()
2064 --Line->Level; in tryToParsePropertyAccessor()
2493 static FormatToken *getLastNonComment(const UnwrappedLine &Line) { in getLastNonComment() argument
2494 for (const auto &Token : llvm::reverse(Line.Tokens)) in getLastNonComment()
2504 if (Style.InsertBraces && !Line->InPPDirective && !Line->Tokens.empty() && in parseUnbracedBody()
2506 Tok = getLastNonComment(*Line); in parseUnbracedBody()
2517 ++Line->Level; in parseUnbracedBody()
2521 assert(!Line->InPPDirective); in parseUnbracedBody()
2536 --Line->Level; in parseUnbracedBody()
2603 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2637 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2658 ++Line->Level; in parseIfThenElse()
2669 --Line->Level; in parseIfThenElse()
2747 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2758 ++Line->Level; in parseTryCatch()
2760 --Line->Level; in parseTryCatch()
2787 Line->MustBeDeclaration = false; in parseTryCatch()
2788 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2840 ++Line->Level; in parseNamespace()
2854 --Line->Level; in parseNamespace()
2904 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseLoopBody()
2956 ++Line->Level; in parseDoWhile()
2964 unsigned OldLineLevel = Line->Level; in parseLabel()
2965 if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) in parseLabel()
2966 --Line->Level; in parseLabel()
2968 Line->Level = 0; in parseLabel()
2973 CompoundStatementIndenter Indenter(this, Line->Level, in parseLabel()
2983 ++Line->Level; in parseLabel()
2994 Line->Level = OldLineLevel; in parseLabel()
3020 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
3025 ++Line->Level; in parseSwitch()
3027 --Line->Level; in parseSwitch()
3529 Line->Level += 1; in parseEnum()
3534 Line->Level -= 1; in parseEnum()
3639 ++Line->Level; in parseJavaEnumBody()
3667 --Line->Level; in parseJavaEnumBody()
3968 if (Line->Tokens.empty()) { in parseJavaScriptEs6ImportExport()
3992 LLVM_ATTRIBUTE_UNUSED static void printDebugInfo(const UnwrappedLine &Line, in printDebugInfo() argument
3994 llvm::dbgs() << Prefix << "Line(" << Line.Level in printDebugInfo()
3995 << ", FSC=" << Line.FirstStartColumn << ")" in printDebugInfo()
3996 << (Line.InPPDirective ? " MACRO" : "") << ": "; in printDebugInfo()
3997 for (const auto &Node : Line.Tokens) { in printDebugInfo()
4002 for (const auto &Node : Line.Tokens) in printDebugInfo()
4010 if (Line->Tokens.empty()) in addUnwrappedLine()
4014 printDebugInfo(*Line); in addUnwrappedLine()
4022 Line->MatchingOpeningBlockLineIndex != UnwrappedLine::kInvalidIndex && in addUnwrappedLine()
4025 CurrentLines->push_back(std::move(*Line)); in addUnwrappedLine()
4026 Line->Tokens.clear(); in addUnwrappedLine()
4027 Line->MatchingOpeningBlockLineIndex = UnwrappedLine::kInvalidIndex; in addUnwrappedLine()
4028 Line->FirstStartColumn = 0; in addUnwrappedLine()
4031 --Line->Level; in addUnwrappedLine()
4045 return (Line->InPPDirective || FormatTok.HasUnescapedNewline) && in isOnNewLine()
4053 const UnwrappedLine &Line, in continuesLineCommentSection() argument
4055 if (Line.Tokens.empty()) in continuesLineCommentSection()
4132 const FormatToken *MinColumnToken = Line.Tokens.front().Tok; in continuesLineCommentSection()
4137 for (const UnwrappedLineNode &Node : Line.Tokens) { in continuesLineCommentSection()
4152 return continuesLineComment(FormatTok, /*Previous=*/Line.Tokens.back().Tok, in continuesLineCommentSection()
4157 bool JustComments = Line->Tokens.empty(); in flushComments()
4168 continuesLineCommentSection(*Tok, *Line, CommentPragmasRegex); in flushComments()
4242 continuesLineCommentSection(*FormatTok, *Line, CommentPragmasRegex); in distributeComments()
4293 while (!Line->InPPDirective && FormatTok->is(tok::hash) && in readToken()
4301 bool SwitchToPreprocessorLines = !Line->Tokens.empty(); in readToken()
4304 static_cast<unsigned>(-LevelDifference) <= Line->Level) && in readToken()
4306 Line->Level += LevelDifference; in readToken()
4312 Line->Level += PPBranchLevel; in readToken()
4322 !Line->InPPDirective) { in readToken()
4340 Line->Tokens.push_back(UnwrappedLineNode(Tok)); in pushToken()
4342 Line->Tokens.back().Tok->MustBreakBefore = true; in pushToken()