void UnwrappedLineParser::parseParens() { assert(FormatTok->Tok.is(tok::l_paren) && "'(' expected."); nextToken(); do { switch (FormatTok->Tok.getKind()) { case tok::l_paren: parseParens(); break; case tok::r_paren: nextToken(); return; case tok::l_brace: { if (!tryToParseBracedList()) { nextToken(); ScopedLineState LineState(*this); ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, /*MustBeDeclaration=*/ false); Line->Level += 1; parseLevel(/*HasOpeningBrace=*/ true); Line->Level -= 1; } break; } case tok::at: nextToken(); if (FormatTok->Tok.is(tok::l_brace)) parseBracedList(); break; default: nextToken(); break; } } while (!eof()); }
void UnwrappedLineParser::parseChildBlock() { FormatTok->BlockKind = BK_Block; nextToken(); { ScopedLineState LineState(*this); ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, /*MustBeDeclaration=*/false); Line->Level += 1; parseLevel(/*HasOpeningBrace=*/true); Line->Level -= 1; } nextToken(); }
void UnwrappedLineParser::parseChildBlock() { FormatTok->BlockKind = BK_Block; nextToken(); { bool GoogScope = Style.Language == FormatStyle::LK_JavaScript && IsGoogScope(*Line); ScopedLineState LineState(*this); ScopedDeclarationState DeclarationState(*Line, DeclarationScopeStack, /*MustBeDeclaration=*/false); Line->Level += GoogScope ? 0 : 1; parseLevel(/*HasOpeningBrace=*/true); Line->Level -= GoogScope ? 0 : 1; } nextToken(); }
bool GetMesherDirtyState(ICENodeContext& in_ctxt ) { CICEPortState LineState( in_ctxt, ID_IN_ToonixLine ); bool lineDirty = LineState.IsDirty( CICEPortState::siAnyDirtyState ); LineState.ClearState(); CICEPortState SubdivState( in_ctxt, ID_IN_Subdiv ); bool subdivDirty = SubdivState.IsDirty( CICEPortState::siAnyDirtyState ); SubdivState.ClearState(); CICEPortState ViewState( in_ctxt, ID_IN_ViewPosition ); bool viewDirty = ViewState.IsDirty( CICEPortState::siAnyDirtyState ); ViewState.ClearState(); return(lineDirty||subdivDirty||viewDirty); }
static void createTextRuns(Layout::RunVector& runs, RenderBlockFlow& flow, unsigned& lineCount) { LayoutUnit borderAndPaddingBefore = flow.borderAndPaddingBefore(); LayoutUnit lineHeight = lineHeightFromFlow(flow); LineState line; bool isEndOfContent = false; TextFragmentIterator textFragmentIterator = TextFragmentIterator(flow); do { flow.setLogicalHeight(lineHeight * lineCount + borderAndPaddingBefore); LineState previousLine = line; unsigned previousRunCount = runs.size(); line = LineState(); updateLineConstrains(flow, line, !lineCount); isEndOfContent = createLineRuns(line, previousLine, runs, textFragmentIterator); closeLineEndingAndAdjustRuns(line, runs, previousRunCount, lineCount, textFragmentIterator); } while (!isEndOfContent); }