示例#1
0
 internal override MSAst.Expression TransformSet(SourceSpan span, MSAst.Expression right, PythonOperationKind op)
 {
     if (op == PythonOperationKind.None)
     {
         return(GlobalParent.AddDebugInfoAndVoid(
                    GlobalParent.Set(
                        _name,
                        _target,
                        right
                        ),
                    span
                    ));
     }
     else
     {
         MSAst.ParameterExpression temp = Ast.Variable(typeof(object), "inplace");
         return(GlobalParent.AddDebugInfo(
                    Ast.Block(
                        new[] { temp },
                        Ast.Assign(temp, _target),
                        SetMemberOperator(right, op, temp),
                        AstUtils.Empty()
                        ),
                    Span.Start,
                    span.End
                    ));
     }
 }
示例#2
0
 private MSAst.Expression SetMemberOperator(MSAst.Expression right, PythonOperationKind op, MSAst.ParameterExpression temp)
 {
     return(GlobalParent.Set(
                _name,
                temp,
                GlobalParent.Operation(
                    typeof(object),
                    op,
                    GlobalParent.Get(
                        _name,
                        temp
                        ),
                    right
                    )
                ));
 }