Esempio n. 1
0
        MSAst.Expression CreatePostfixedExpression(Expression target, MSAst.ExpressionType op)
        {
            if (op == MSAst.ExpressionType.PostIncrementAssign)
                op = MSAst.ExpressionType.Increment;
            else
                op = MSAst.ExpressionType.Decrement;

            MSAst.ParameterExpression tmp = Ast.Parameter(typeof(object), "<post_operation>");
            return GlobalParent.AddDebugInfo(
                Ast.Block(
                    new[] { tmp },
                    Ast.Assign(tmp, target),
                    target.TransformSet(Span,
                        GlobalParent.Operation(
                            typeof(object),
                            op,
                            tmp
                        ),
                        MSAst.ExpressionType.Default
                    ),
                    tmp
                ),
                Span
            );
        }
Esempio n. 2
0
        MSAst.Expression CreatePrefixedExpression(Expression target, MSAst.ExpressionType op)
        {
            if (op == MSAst.ExpressionType.PreIncrementAssign)
                op = MSAst.ExpressionType.Increment;
            else
                op = MSAst.ExpressionType.Decrement;

            return target.TransformSet(Span,
                GlobalParent.Operation(
                    typeof(object),
                    op,
                    target
                ),
                MSAst.ExpressionType.Default
            );
        }