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::__anond4a2c0880111::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::__anond4a2c0880111::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()
767 size_t Line = CurrentLines->size(); in conditionalCompilationCondition() local
769 Line += Lines.size(); in conditionalCompilationCondition()
773 PPStack.push_back({PP_Unreachable, Line}); in conditionalCompilationCondition()
775 PPStack.push_back({PP_Conditional, Line}); in conditionalCompilationCondition()
831 for (auto &Line : Lines) { in parsePPIf() local
832 if (!Line.Tokens.front().Tok->is(tok::comment)) { in parsePPIf()
887 for (auto &Line : Lines) { in parsePPDefine() local
888 if (!Line.Tokens.front().Tok->isOneOf(tok::comment, tok::hash)) { in parsePPDefine()
902 Line->Level += PPBranchLevel + 1; in parsePPDefine()
904 ++Line->Level; in parsePPDefine()
919 Line->Level += PPBranchLevel + 1; in parsePPUnknown()
1020 bool HasAt = std::find_if(Line->Tokens.begin(), Line->Tokens.end(), in readTokenWithJavaScriptASI()
1023 }) != Line->Tokens.end(); in readTokenWithJavaScriptASI()
1083 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1090 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1096 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1102 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1108 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1119 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1126 if (Style.Language == FormatStyle::LK_JavaScript && Line->MustBeDeclaration) in parseStructuralElement()
1378 Line->MustBeDeclaration) { in parseStructuralElement()
1390 Line->MustBeDeclaration) { in parseStructuralElement()
1404 size_t TokenCount = Line->Tokens.size(); in parseStructuralElement()
1407 (TokenCount > 1 || (TokenCount == 1 && !Line->Tokens.front().Tok->is( in parseStructuralElement()
1454 TokenCount = Line->Tokens.size(); in parseStructuralElement()
1456 (TokenCount == 2 && Line->Tokens.front().Tok->is(tok::comment))) { in parseStructuralElement()
1457 if (FormatTok->Tok.is(tok::colon) && !Line->MustBeDeclaration) { in parseStructuralElement()
1458 Line->Tokens.begin()->Tok->MustBreakBefore = true; in parseStructuralElement()
1585 ++Line->Level; in tryToParsePropertyAccessor()
1588 --Line->Level; in tryToParsePropertyAccessor()
1592 ++Line->Level; in tryToParsePropertyAccessor()
1598 --Line->Level; in tryToParsePropertyAccessor()
2000 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2008 ++Line->Level; in parseIfThenElse()
2010 --Line->Level; in parseIfThenElse()
2018 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
2025 ++Line->Level; in parseIfThenElse()
2029 --Line->Level; in parseIfThenElse()
2072 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2084 ++Line->Level; in parseTryCatch()
2086 --Line->Level; in parseTryCatch()
2110 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
2155 ++Line->Level; in parseNamespace()
2169 --Line->Level; in parseNamespace()
2223 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseForOrWhileLoop()
2228 ++Line->Level; in parseForOrWhileLoop()
2230 --Line->Level; in parseForOrWhileLoop()
2238 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseDoWhile()
2244 ++Line->Level; in parseDoWhile()
2246 --Line->Level; in parseDoWhile()
2258 ++Line->Level; in parseDoWhile()
2266 unsigned OldLineLevel = Line->Level; in parseLabel()
2267 if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) in parseLabel()
2268 --Line->Level; in parseLabel()
2270 Line->Level = 0; in parseLabel()
2275 CompoundStatementIndenter Indenter(this, Line->Level, in parseLabel()
2285 Line->Level++; in parseLabel()
2296 Line->Level = OldLineLevel; in parseLabel()
2319 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
2324 ++Line->Level; in parseSwitch()
2326 --Line->Level; in parseSwitch()
2352 parseRequiresExpression(Line->Level); in parseConcept()
2354 parseConstraintExpression(Line->Level); in parseConcept()
2362 if (Style.IndentRequires && OriginalLevel != Line->Level) { in parseRequiresExpression()
2364 --Line->Level; in parseRequiresExpression()
2425 if (Style.IndentRequires && OriginalLevel != Line->Level) { in parseConstraintExpression()
2426 --Line->Level; in parseConstraintExpression()
2440 unsigned OriginalLevel = Line->Level; in parseRequires()
2444 Line->Level++; in parseRequires()
2509 Line->Level += 1; in parseEnum()
2514 Line->Level -= 1; in parseEnum()
2618 ++Line->Level; in parseJavaEnumBody()
2646 --Line->Level; in parseJavaEnumBody()
2917 if (Line->Tokens.empty()) { in parseJavaScriptEs6ImportExport()
2941 LLVM_ATTRIBUTE_UNUSED static void printDebugInfo(const UnwrappedLine &Line, in printDebugInfo() argument
2943 llvm::dbgs() << Prefix << "Line(" << Line.Level in printDebugInfo()
2944 << ", FSC=" << Line.FirstStartColumn << ")" in printDebugInfo()
2945 << (Line.InPPDirective ? " MACRO" : "") << ": "; in printDebugInfo()
2946 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
2947 E = Line.Tokens.end(); in printDebugInfo()
2953 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
2954 E = Line.Tokens.end(); in printDebugInfo()
2968 if (Line->Tokens.empty()) in addUnwrappedLine()
2972 printDebugInfo(*Line); in addUnwrappedLine()
2980 Line->MatchingOpeningBlockLineIndex != UnwrappedLine::kInvalidIndex && in addUnwrappedLine()
2983 CurrentLines->push_back(std::move(*Line)); in addUnwrappedLine()
2984 Line->Tokens.clear(); in addUnwrappedLine()
2985 Line->MatchingOpeningBlockLineIndex = UnwrappedLine::kInvalidIndex; in addUnwrappedLine()
2986 Line->FirstStartColumn = 0; in addUnwrappedLine()
2989 --Line->Level; in addUnwrappedLine()
3003 return (Line->InPPDirective || FormatTok.HasUnescapedNewline) && in isOnNewLine()
3011 const UnwrappedLine &Line, in continuesLineCommentSection() argument
3013 if (Line.Tokens.empty()) in continuesLineCommentSection()
3089 const FormatToken *MinColumnToken = Line.Tokens.front().Tok; in continuesLineCommentSection()
3094 for (const UnwrappedLineNode &Node : Line.Tokens) { in continuesLineCommentSection()
3111 return continuesLineComment(FormatTok, /*Previous=*/Line.Tokens.back().Tok, in continuesLineCommentSection()
3116 bool JustComments = Line->Tokens.empty(); in flushComments()
3130 continuesLineCommentSection(**I, *Line, CommentPragmasRegex); in flushComments()
3194 continuesLineCommentSection(*FormatTok, *Line, CommentPragmasRegex); in distributeComments()
3213 while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) && in readToken()
3219 bool SwitchToPreprocessorLines = !Line->Tokens.empty(); in readToken()
3222 static_cast<unsigned>(-LevelDifference) <= Line->Level) && in readToken()
3224 Line->Level += LevelDifference; in readToken()
3230 Line->Level += PPBranchLevel; in readToken()
3249 !Line->InPPDirective) { in readToken()
3267 Line->Tokens.push_back(UnwrappedLineNode(Tok)); in pushToken()
3269 Line->Tokens.back().Tok->MustBreakBefore = true; in pushToken()