Exemplo n.º 1
0
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());
}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
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();
}
Exemplo n.º 4
0
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);
}
Exemplo n.º 5
0
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);
}