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::__anon2b5cbe510111::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::__anon2b5cbe510111::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 = std::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()
230 : Line(new UnwrappedLine), MustBreakBeforeNextToken(false), in UnwrappedLineParser()
245 Line.reset(new UnwrappedLine); in reset()
253 Line->FirstStartColumn = FirstStartColumn; in reset()
258 Line->FirstStartColumn = FirstStartColumn; in parse()
271 for (auto &Line : Lines) in parse() local
272 if (Line.InPPDirective && Line.Level > 0) in parse()
273 --Line.Level; in parse()
303 !Line->InPPDirective && Style.Language != FormatStyle::LK_JavaScript; in parseFile()
304 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseFile()
415 Line->MustBeDeclaration) { in parseLevel()
421 (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1))) in parseLevel()
422 ++Line->Level; in parseLevel()
577 hash_combine(h, i.Line); in computePPHash()
593 ++Line->Level; in parseBlock()
597 unsigned InitialLevel = Line->Level; in parseBlock()
615 --Line->Level; in parseBlock()
617 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseBlock()
620 Line->Level += AddLevels; in parseBlock()
628 Line->Level = InitialLevel; in parseBlock()
651 Line->Level = InitialLevel; in parseBlock()
654 Line->MatchingOpeningBlockLineIndex = OpeningLineIndex; in parseBlock()
663 static bool isGoogScope(const UnwrappedLine &Line) { in isGoogScope() argument
666 if (Line.Tokens.size() < 4) in isGoogScope()
668 auto I = Line.Tokens.begin(); in isGoogScope()
681 static bool isIIFE(const UnwrappedLine &Line, in isIIFE() argument
687 if (Line.Tokens.size() < 3) in isIIFE()
689 auto I = Line.Tokens.begin(); in isIIFE()
717 (isGoogScope(*Line) || isIIFE(*Line, Keywords))); in parseChildBlock()
719 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseChildBlock()
721 Line->Level += SkipIndent ? 0 : 1; in parseChildBlock()
724 Line->Level -= SkipIndent ? 0 : 1; in parseChildBlock()
731 ScopedMacroState MacroState(*Line, Tokens, FormatTok); in parsePPDirective()
769 size_t Line = CurrentLines->size(); in conditionalCompilationCondition() local
771 Line += Lines.size(); in conditionalCompilationCondition()
775 PPStack.push_back({PP_Unreachable, Line}); in conditionalCompilationCondition()
777 PPStack.push_back({PP_Conditional, Line}); in conditionalCompilationCondition()
833 for (auto &Line : Lines) { in parsePPIf() local
834 if (!Line.Tokens.front().Tok->is(tok::comment)) { in parsePPIf()
889 for (auto &Line : Lines) { in parsePPDefine() local
890 if (!Line.Tokens.front().Tok->isOneOf(tok::comment, tok::hash)) { in parsePPDefine()
904 Line->Level += PPBranchLevel + 1; in parsePPDefine()
906 ++Line->Level; in parsePPDefine()
921 Line->Level += PPBranchLevel + 1; in parsePPUnknown()
1067 bool HasAt = std::find_if(Line->Tokens.begin(), Line->Tokens.end(), in readTokenWithJavaScriptASI()
1070 }) != Line->Tokens.end(); in readTokenWithJavaScriptASI()
1130 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1137 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1143 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1149 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1155 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1166 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1173 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1436 Line->MustBeDeclaration) { in parseStructuralElement()
1448 Line->MustBeDeclaration) { in parseStructuralElement()
1462 size_t TokenCount = Line->Tokens.size(); in parseStructuralElement()
1465 (TokenCount > 1 || (TokenCount == 1 && !Line->Tokens.front().Tok->is( in parseStructuralElement()
1512 TokenCount = Line->Tokens.size(); in parseStructuralElement()
1514 (TokenCount == 2 && Line->Tokens.front().Tok->is(tok::comment))) { in parseStructuralElement()
1515 if (FormatTok->Tok.is(tok::colon) && !Line->MustBeDeclaration) { in parseStructuralElement()
1516 Line->Tokens.begin()->Tok->MustBreakBefore = true; in parseStructuralElement()
1643 ++Line->Level; in tryToParsePropertyAccessor()
1646 --Line->Level; in tryToParsePropertyAccessor()
1650 ++Line->Level; in tryToParsePropertyAccessor()
1656 --Line->Level; in tryToParsePropertyAccessor()
2070 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2078 ++Line->Level; in parseIfThenElse()
2080 --Line->Level; in parseIfThenElse()
2088 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2096 ++Line->Level; in parseIfThenElse()
2100 --Line->Level; in parseIfThenElse()
2103 ++Line->Level; in parseIfThenElse()
2107 --Line->Level; in parseIfThenElse()
2150 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2162 ++Line->Level; in parseTryCatch()
2164 --Line->Level; in parseTryCatch()
2188 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2233 ++Line->Level; in parseNamespace()
2247 --Line->Level; in parseNamespace()
2301 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseForOrWhileLoop()
2306 ++Line->Level; in parseForOrWhileLoop()
2308 --Line->Level; in parseForOrWhileLoop()
2316 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseDoWhile()
2322 ++Line->Level; in parseDoWhile()
2324 --Line->Level; in parseDoWhile()
2336 ++Line->Level; in parseDoWhile()
2344 unsigned OldLineLevel = Line->Level; in parseLabel()
2345 if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) in parseLabel()
2346 --Line->Level; in parseLabel()
2348 Line->Level = 0; in parseLabel()
2353 CompoundStatementIndenter Indenter(this, Line->Level, in parseLabel()
2363 Line->Level++; in parseLabel()
2374 Line->Level = OldLineLevel; in parseLabel()
2397 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
2402 ++Line->Level; in parseSwitch()
2404 --Line->Level; in parseSwitch()
2430 parseRequiresExpression(Line->Level); in parseConcept()
2432 parseConstraintExpression(Line->Level); in parseConcept()
2440 if (Style.IndentRequires && OriginalLevel != Line->Level) { in parseRequiresExpression()
2442 --Line->Level; in parseRequiresExpression()
2503 if (Style.IndentRequires && OriginalLevel != Line->Level) { in parseConstraintExpression()
2504 --Line->Level; in parseConstraintExpression()
2518 unsigned OriginalLevel = Line->Level; in parseRequires()
2522 Line->Level++; in parseRequires()
2587 Line->Level += 1; in parseEnum()
2592 Line->Level -= 1; in parseEnum()
2696 ++Line->Level; in parseJavaEnumBody()
2724 --Line->Level; in parseJavaEnumBody()
2995 if (Line->Tokens.empty()) { in parseJavaScriptEs6ImportExport()
3019 LLVM_ATTRIBUTE_UNUSED static void printDebugInfo(const UnwrappedLine &Line, in printDebugInfo() argument
3021 llvm::dbgs() << Prefix << "Line(" << Line.Level in printDebugInfo()
3022 << ", FSC=" << Line.FirstStartColumn << ")" in printDebugInfo()
3023 << (Line.InPPDirective ? " MACRO" : "") << ": "; in printDebugInfo()
3024 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
3025 E = Line.Tokens.end(); in printDebugInfo()
3031 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
3032 E = Line.Tokens.end(); in printDebugInfo()
3046 if (Line->Tokens.empty()) in addUnwrappedLine()
3050 printDebugInfo(*Line); in addUnwrappedLine()
3058 Line->MatchingOpeningBlockLineIndex != UnwrappedLine::kInvalidIndex && in addUnwrappedLine()
3061 CurrentLines->push_back(std::move(*Line)); in addUnwrappedLine()
3062 Line->Tokens.clear(); in addUnwrappedLine()
3063 Line->MatchingOpeningBlockLineIndex = UnwrappedLine::kInvalidIndex; in addUnwrappedLine()
3064 Line->FirstStartColumn = 0; in addUnwrappedLine()
3067 --Line->Level; in addUnwrappedLine()
3081 return (Line->InPPDirective || FormatTok.HasUnescapedNewline) && in isOnNewLine()
3089 const UnwrappedLine &Line, in continuesLineCommentSection() argument
3091 if (Line.Tokens.empty()) in continuesLineCommentSection()
3167 const FormatToken *MinColumnToken = Line.Tokens.front().Tok; in continuesLineCommentSection()
3172 for (const UnwrappedLineNode &Node : Line.Tokens) { in continuesLineCommentSection()
3189 return continuesLineComment(FormatTok, /*Previous=*/Line.Tokens.back().Tok, in continuesLineCommentSection()
3194 bool JustComments = Line->Tokens.empty(); in flushComments()
3208 continuesLineCommentSection(**I, *Line, CommentPragmasRegex); in flushComments()
3272 continuesLineCommentSection(*FormatTok, *Line, CommentPragmasRegex); in distributeComments()
3291 while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) && in readToken()
3297 bool SwitchToPreprocessorLines = !Line->Tokens.empty(); in readToken()
3300 static_cast<unsigned>(-LevelDifference) <= Line->Level) && in readToken()
3302 Line->Level += LevelDifference; in readToken()
3308 Line->Level += PPBranchLevel; in readToken()
3327 !Line->InPPDirective) { in readToken()
3345 Line->Tokens.push_back(UnwrappedLineNode(Tok)); in pushToken()
3347 Line->Tokens.back().Tok->MustBreakBefore = true; in pushToken()