Lines Matching refs:Line
39 ScopedDeclarationState(UnwrappedLine &Line, std::vector<bool> &Stack, in ScopedDeclarationState() argument
41 : Line(Line), Stack(Stack) { in ScopedDeclarationState()
42 Line.MustBeDeclaration = MustBeDeclaration; in ScopedDeclarationState()
48 Line.MustBeDeclaration = Stack.back(); in ~ScopedDeclarationState()
50 Line.MustBeDeclaration = true; in ~ScopedDeclarationState()
54 UnwrappedLine &Line; member in clang::format::__anonfa4918600111::ScopedDeclarationState
60 ScopedMacroState(UnwrappedLine &Line, FormatTokenSource *&TokenSource, in ScopedMacroState() argument
62 : Line(Line), TokenSource(TokenSource), ResetToken(ResetToken), in ScopedMacroState()
63 PreviousLineLevel(Line.Level), PreviousTokenSource(TokenSource), in ScopedMacroState()
66 Line.Level = 0; in ScopedMacroState()
67 Line.InPPDirective = true; in ScopedMacroState()
73 Line.InPPDirective = false; in ~ScopedMacroState()
74 Line.Level = PreviousLineLevel; in ~ScopedMacroState()
108 UnwrappedLine &Line; member in clang::format::__anonfa4918600111::ScopedMacroState
126 else if (!Parser.Line->Tokens.empty()) in ScopedLineState()
127 Parser.CurrentLines = &Parser.Line->Tokens.back().Children; in ScopedLineState()
128 PreBlockLine = std::move(Parser.Line); in ScopedLineState()
129 Parser.Line = llvm::make_unique<UnwrappedLine>(); in ScopedLineState()
130 Parser.Line->Level = PreBlockLine->Level; in ScopedLineState()
131 Parser.Line->InPPDirective = PreBlockLine->InPPDirective; in ScopedLineState()
135 if (!Parser.Line->Tokens.empty()) { in ~ScopedLineState()
138 assert(Parser.Line->Tokens.empty()); in ~ScopedLineState()
139 Parser.Line = std::move(PreBlockLine); in ~ScopedLineState()
204 : Line(new UnwrappedLine), MustBreakBeforeNextToken(false), in UnwrappedLineParser()
210 Line.reset(new UnwrappedLine); in reset()
258 !Line->InPPDirective && Style.Language != FormatStyle::LK_JavaScript; in parseFile()
259 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseFile()
299 (Style.IndentCaseLabels || (Line->InPPDirective && Line->Level == 1))) in parseLevel()
300 ++Line->Level; in parseLevel()
408 unsigned InitialLevel = Line->Level; in parseBlock()
416 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseBlock()
419 ++Line->Level; in parseBlock()
424 Line->Level = InitialLevel; in parseBlock()
436 Line->Level = InitialLevel; in parseBlock()
439 static bool isGoogScope(const UnwrappedLine &Line) { in isGoogScope() argument
442 if (Line.Tokens.size() < 4) in isGoogScope()
444 auto I = Line.Tokens.begin(); in isGoogScope()
475 Style.Language == FormatStyle::LK_JavaScript && isGoogScope(*Line); in parseChildBlock()
477 ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, in parseChildBlock()
479 Line->Level += GoogScope ? 0 : 1; in parseChildBlock()
482 Line->Level -= GoogScope ? 0 : 1; in parseChildBlock()
489 ScopedMacroState MacroState(*Line, Tokens, FormatTok); in parsePPDirective()
606 Line->Level = 1; in parsePPDefine()
905 FormatTok->is(Keywords.kw_function) && Line->Tokens.size() > 0) { in parseStructuralElement()
919 if (Line->Tokens.size() == 1 && in parseStructuralElement()
923 if (FormatTok->Tok.is(tok::colon) && !Line->MustBeDeclaration) { in parseStructuralElement()
982 if (!Line->Tokens.empty() && in tryToParseLambda()
983 (Line->Tokens.back().Tok->isOneOf(tok::identifier, tok::kw_operator, in tryToParseLambda()
985 Line->Tokens.back().Tok->closesScope() || in tryToParseLambda()
986 Line->Tokens.back().Tok->isSimpleTypeSpecifier())) { in tryToParseLambda()
1268 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
1276 ++Line->Level; in parseIfThenElse()
1278 --Line->Level; in parseIfThenElse()
1283 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseIfThenElse()
1290 ++Line->Level; in parseIfThenElse()
1292 --Line->Level; in parseIfThenElse()
1319 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
1331 ++Line->Level; in parseTryCatch()
1333 --Line->Level; in parseTryCatch()
1357 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseTryCatch()
1424 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseForOrWhileLoop()
1429 ++Line->Level; in parseForOrWhileLoop()
1431 --Line->Level; in parseForOrWhileLoop()
1439 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseDoWhile()
1445 ++Line->Level; in parseDoWhile()
1447 --Line->Level; in parseDoWhile()
1462 unsigned OldLineLevel = Line->Level; in parseLabel()
1463 if (Line->Level > 1 || (!Line->InPPDirective && Line->Level > 0)) in parseLabel()
1464 --Line->Level; in parseLabel()
1466 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseLabel()
1479 Line->Level = OldLineLevel; in parseLabel()
1497 CompoundStatementIndenter Indenter(this, Style, Line->Level); in parseSwitch()
1502 ++Line->Level; in parseSwitch()
1504 --Line->Level; in parseSwitch()
1602 ++Line->Level; in parseJavaEnumBody()
1630 --Line->Level; in parseJavaEnumBody()
1793 LLVM_ATTRIBUTE_UNUSED static void printDebugInfo(const UnwrappedLine &Line, in printDebugInfo() argument
1795 llvm::dbgs() << Prefix << "Line(" << Line.Level << ")" in printDebugInfo()
1796 << (Line.InPPDirective ? " MACRO" : "") << ": "; in printDebugInfo()
1797 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
1798 E = Line.Tokens.end(); in printDebugInfo()
1802 for (std::list<UnwrappedLineNode>::const_iterator I = Line.Tokens.begin(), in printDebugInfo()
1803 E = Line.Tokens.end(); in printDebugInfo()
1817 if (Line->Tokens.empty()) in addUnwrappedLine()
1821 printDebugInfo(*Line); in addUnwrappedLine()
1823 CurrentLines->push_back(std::move(*Line)); in addUnwrappedLine()
1824 Line->Tokens.clear(); in addUnwrappedLine()
1836 return (Line->InPPDirective || FormatTok.HasUnescapedNewline) && in isOnNewLine()
1841 bool JustComments = Line->Tokens.empty(); in flushComments()
1868 while (!Line->InPPDirective && FormatTok->Tok.is(tok::hash) && in readToken()
1872 bool SwitchToPreprocessorLines = !Line->Tokens.empty(); in readToken()
1895 !Line->InPPDirective) { in readToken()
1913 Line->Tokens.push_back(UnwrappedLineNode(Tok)); in pushToken()
1915 Line->Tokens.back().Tok->MustBreakBefore = true; in pushToken()