public override void OnSlicingExpression(SlicingExpression node)
        {
            base.OnSlicingExpression(node);

            if (!node.IsComplexSlicing())
            {
                return;
            }

            if (node.IsTargetOfAssignment())
            {
                return;
            }

            CompleteOmittedExpressions(node);
            ExpandComplexSlicing(node);
        }
Example #2
0
        override public void LeaveSlicingExpression(SlicingExpression node)
        {
            if (!IsDuckTyped(node.Target))
            {
                return;
            }
            if (node.IsTargetOfAssignment())
            {
                return;
            }

            // todo
            // a[foo]
            // RuntimeServices.GetSlice(a, "", (foo,))

            MethodInvocationExpression mie = CodeBuilder.CreateMethodInvocation(
                node.LexicalInfo,
                RuntimeServices_GetSlice,
                GetSlicingTarget(node),
                CodeBuilder.CreateStringLiteral(GetSlicingMemberName(node)),
                GetArrayForIndices(node));

            Replace(mie);
        }