Exemplo n.º 1
0
        void PossiblyBreakExpressionStatement(BinaryExpression node, BlockStatement parentBlock)
        {
            var nodeList = node.Operand2 as AstNodeList;

            if (nodeList != null)
            {
                PossiblyBreakExpressionList(node, parentBlock, nodeList);
            }
            else
            {
                //  not a list
                if (CanBeBroken(node.Operand2))
                {
                    // flatten the operator. We have to explicitly recurse the left-hand side.
                    var temp = node.Operand1;
                    parentBlock.ReplaceChild(node, temp);
                    parentBlock.InsertAfter(temp, node.Operand2);
                    temp.Accept(this);
                }
                else
                {
                    // no change; just recurse normally
                    base.Visit(node);
                }
            }
        }