示例#1
0
        // ArrayIndexExpression
        private Expression Rewrite(ArrayIndexExpression node)
        {
            Expression array = RewriteExpression(node.Array);
            Expression index = RewriteExpression(node.Index);

            if (((object)array != (object)node.Array) ||
                ((object)index != (object)node.Index))
            {
                Expression saveArray, saveIndex;

                array = ToTemp(array, out saveArray);
                index = ToTemp(index, out saveIndex);

                return(Ast.Comma(
                           saveArray,
                           saveIndex,
                           Ast.ArrayIndex(array, index)
                           ));
            }
            else
            {
                return(node);
            }
        }