Lines Matching refs:Line
41 ScopedDeclarationState(UnwrappedLine &Line, std::vector<bool> &Stack, in ScopedDeclarationState() argument
43 : Line(Line), Stack(Stack) { in ScopedDeclarationState()
44 Line.MustBeDeclaration = MustBeDeclaration; in ScopedDeclarationState()
50 Line.MustBeDeclaration = Stack.back(); in ~ScopedDeclarationState()
52 Line.MustBeDeclaration = true; in ~ScopedDeclarationState()
56 UnwrappedLine &Line; member in clang::format::__anon0b30d40c0111::ScopedDeclarationState
81 ScopedMacroState(UnwrappedLine &Line, FormatTokenSource *&TokenSource, in ScopedMacroState() argument
83 : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken), in ScopedMacroState()
84 PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource), in ScopedMacroState()
89 Line.Level = 0; in ScopedMacroState()
90 Line.InPPDirective = true; in ScopedMacroState()
96 Line.InPPDirective = false; in ~ScopedMacroState()
97 Line.Level = PreviousLineLevel; in ~ScopedMacroState()
127 UnwrappedLine &Line; member in clang::format::__anon0b30d40c0111::ScopedMacroState
146 else if (!Parser.Line->Tokens.empty()) in ScopedLineState()
147 Parser.CurrentLines = &Parser.Line->Tokens.back().Children; in ScopedLineState()
148 PreBlockLine = std::move(Parser.Line); in ScopedLineState()
149 Parser.Line = llvm::make_unique<UnwrappedLine>(); in ScopedLineState()
150 Parser.Line->Level = PreBlockLine->Level; in ScopedLineState()
151 Parser.Line->InPPDirective = PreBlockLine->InPPDirective; in ScopedLineState()
155 if (!Parser.Line->Tokens.empty()) { in ~ScopedLineState()
158 assert(Parser.Line->Tokens.empty()); in ~ScopedLineState()
159 Parser.Line = std::move(PreBlockLine); in ~ScopedLineState()
225 : Line(new UnwrappedLine), MustBreakBeforeNextToken(false), in UnwrappedLineParser()
240 Line.reset(new UnwrappedLine); in reset()
248 Line->FirstStartColumn = FirstStartColumn; in reset()
253 Line->FirstStartColumn = FirstStartColumn; in parse()
266 for (auto &Line : Lines) in parse() local
267 if (Line.InPPDirective && Line.Level > 0) in parse()
268 --Line.Level; in parse()
298 !Line->InPPDirective && Style.Language != FormatStyle::LK_JavaScript; in parseFile()
299 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseFile()
369 Line->MustBeDeclaration) { in parseLevel()
375 (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1))) in parseLevel()
376 ++Line->Level; in parseLevel()
524 hash_combine(h, i.Line); in computePPHash()
538 unsigned InitialLevel = Line->Level; in parseBlock()
552 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseBlock()
555 ++Line->Level; in parseBlock()
563 Line->Level = InitialLevel; in parseBlock()
578 Line->Level = InitialLevel; in parseBlock()
581 Line->MatchingOpeningBlockLineIndex = OpeningLineIndex; in parseBlock()
590 static bool isGoogScope(const UnwrappedLine &Line) { in isGoogScope() argument
593 if (Line.Tokens.size() < 4) in isGoogScope()
595 auto I = Line.Tokens.begin(); in isGoogScope()
608 static bool isIIFE(const UnwrappedLine &Line, in isIIFE() argument
614 if (Line.Tokens.size() < 3) in isIIFE()
616 auto I = Line.Tokens.begin(); in isIIFE()
644 (isGoogScope(*Line) || isIIFE(*Line, Keywords))); in parseChildBlock()
646 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseChildBlock()
648 Line->Level += SkipIndent ? 0 : 1; in parseChildBlock()
651 Line->Level -= SkipIndent ? 0 : 1; in parseChildBlock()
658 ScopedMacroState MacroState(*Line, Tokens, FormatTok); in parsePPDirective()
693 size_t Line = CurrentLines->size(); in conditionalCompilationCondition() local
695 Line += Lines.size(); in conditionalCompilationCondition()
699 PPStack.push_back({PP_Unreachable, Line}); in conditionalCompilationCondition()
701 PPStack.push_back({PP_Conditional, Line}); in conditionalCompilationCondition()
757 for (auto &Line : Lines) { in parsePPIf() local
758 if (!Line.Tokens.front().Tok->is(tok::comment)) { in parsePPIf()
813 for (auto &Line : Lines) { in parsePPDefine() local
814 if (!Line.Tokens.front().Tok->isOneOf(tok::comment, tok::hash)) { in parsePPDefine()
828 Line->Level += PPBranchLevel + 1; in parsePPDefine()
830 ++Line->Level; in parsePPDefine()
845 Line->Level += PPBranchLevel + 1; in parsePPUnknown()
946 bool HasAt = std::find_if(Line->Tokens.begin(), Line->Tokens.end(), in readTokenWithJavaScriptASI()
949 }) != Line->Tokens.end(); in readTokenWithJavaScriptASI()
1019 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1025 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1036 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1295 size_t TokenCount = Line->Tokens.size(); in parseStructuralElement()
1298 (TokenCount > 1 || (TokenCount == 1 && !Line->Tokens.front().Tok->is( in parseStructuralElement()
1332 if (Line->Tokens.size() == 1 && in parseStructuralElement()
1336 if (FormatTok->Tok.is(tok::colon) && !Line->MustBeDeclaration) { in parseStructuralElement()
1337 Line->Tokens.begin()->Tok->MustBreakBefore = true; in parseStructuralElement()
1706 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
1714 ++Line->Level; in parseIfThenElse()
1716 --Line->Level; in parseIfThenElse()
1721 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
1728 ++Line->Level; in parseIfThenElse()
1732 --Line->Level; in parseIfThenElse()
1759 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
1771 ++Line->Level; in parseTryCatch()
1773 --Line->Level; in parseTryCatch()
1797 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
1868 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseForOrWhileLoop()
1873 ++Line->Level; in parseForOrWhileLoop()
1875 --Line->Level; in parseForOrWhileLoop()
1883 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseDoWhile()
1889 ++Line->Level; in parseDoWhile()
1891 --Line->Level; in parseDoWhile()
1906 unsigned OldLineLevel = Line->Level; in parseLabel()
1907 if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) in parseLabel()
1908 --Line->Level; in parseLabel()
1910 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseLabel()
1923 Line->Level = OldLineLevel; in parseLabel()
1945 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
1950 ++Line->Level; in parseSwitch()
1952 --Line->Level; in parseSwitch()
2060 ++Line->Level; in parseJavaEnumBody()
2088 --Line->Level; in parseJavaEnumBody()
2335 if (Line->Tokens.empty()) { in parseJavaScriptEs6ImportExport()
2360 LLVM_ATTRIBUTE_UNUSED static void printDebugInfo(const UnwrappedLine &Line, in printDebugInfo() argument
2362 llvm::dbgs() << Prefix << "Line(" << Line.Level in printDebugInfo()
2363 << ", FSC=" << Line.FirstStartColumn << ")" in printDebugInfo()
2364 << (Line.InPPDirective ? " MACRO" : "") << ": "; in printDebugInfo()
2365 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
2366 E = Line.Tokens.end(); in printDebugInfo()
2372 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
2373 E = Line.Tokens.end(); in printDebugInfo()
2387 if (Line->Tokens.empty()) in addUnwrappedLine()
2391 printDebugInfo(*Line); in addUnwrappedLine()
2393 CurrentLines->push_back(std::move(*Line)); in addUnwrappedLine()
2394 Line->Tokens.clear(); in addUnwrappedLine()
2395 Line->MatchingOpeningBlockLineIndex = UnwrappedLine::kInvalidIndex; in addUnwrappedLine()
2396 Line->FirstStartColumn = 0; in addUnwrappedLine()
2410 return (Line->InPPDirective || FormatTok.HasUnescapedNewline) && in isOnNewLine()
2417 const UnwrappedLine &Line, in continuesLineCommentSection() argument
2419 if (Line.Tokens.empty()) in continuesLineCommentSection()
2495 const FormatToken *MinColumnToken = Line.Tokens.front().Tok; in continuesLineCommentSection()
2500 for (const UnwrappedLineNode &Node : Line.Tokens) { in continuesLineCommentSection()
2517 return continuesLineComment(FormatTok, /*Previous=*/Line.Tokens.back().Tok, in continuesLineCommentSection()
2522 bool JustComments = Line->Tokens.empty(); in flushComments()
2536 continuesLineCommentSection(**I, *Line, CommentPragmasRegex); in flushComments()
2600 continuesLineCommentSection(*FormatTok, *Line, CommentPragmasRegex); in distributeComments()
2619 while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) && in readToken()
2625 bool SwitchToPreprocessorLines = !Line->Tokens.empty(); in readToken()
2628 static_cast<unsigned>(-LevelDifference) <= Line->Level) && in readToken()
2630 Line->Level += LevelDifference; in readToken()
2652 !Line->InPPDirective) { in readToken()
2670 Line->Tokens.push_back(UnwrappedLineNode(Tok)); in pushToken()
2672 Line->Tokens.back().Tok->MustBreakBefore = true; in pushToken()