Пример #1
0
 // BoundAssignment
 private void DefaultWalk(BoundAssignment node)
 {
     if (Walk(node))
     {
         WalkNode(node.Value);
     }
     PostWalk(node);
 }
Пример #2
0
        // BoundAssignment
        private Expression Rewrite(BoundAssignment node)
        {
            Expression value = RewriteExpression(node.Value);

            if ((object)value != (object)node.Value)
            {
                return(Ast.Assign(node.Variable, value));
            }
            else
            {
                return(node);
            }
        }
Пример #3
0
        protected override object DoExecute(CodeContext context)
        {
            bool      rethrow  = false;
            Exception savedExc = null;
            object    ret      = Statement.NextStatement;

            try {
                ret = _body.Execute(context);
            } catch (Exception exc) {
                rethrow  = true;
                savedExc = exc;
                if (_handlers != null)
                {
                    PushEvalException(exc);
                    try {
                        foreach (CatchBlock handler in _handlers)
                        {
                            if (handler.Test.IsInstanceOfType(exc))
                            {
                                rethrow = false;
                                if (handler.Variable != null)
                                {
                                    BoundAssignment.EvaluateAssign(context, handler.Variable, exc);
                                }
                                ret = handler.Body.Execute(context);
                                break;
                            }
                        }
                    } finally {
                        PopEvalException();
                    }
                }
            } finally {
                if (_finally != null)
                {
                    object finallyRet = _finally.Execute(context);
                    if (finallyRet != Statement.NextStatement)
                    {
                        ret     = finallyRet;
                        rethrow = false;
                    }
                }
                if (rethrow)
                {
                    throw ExceptionHelpers.UpdateForRethrow(savedExc);
                }
            }

            return(ret);
        }
Пример #4
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return(true);
 }
Пример #5
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return true;
 }
Пример #6
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return false;
 }
Пример #7
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return(false);
 }
Пример #8
0
 // BoundAssignment
 private void DefaultWalk(BoundAssignment node)
 {
     if (Walk(node)) {
         WalkNode(node.Value);
     }
     PostWalk(node);
 }
        protected override void PostWalk(BoundAssignment node)
        {
          base.PostWalk(node);

          var val = node.Value;
          var var = node.Variable;

          val = ProcessAssignment(val, var);
          node.Value = val;
        }
        protected override bool Walk(BoundAssignment node)
        {
          var val = node.Value;
          var var = node.Variable;

          ProcessAssignment(val, var, true);  

          return base.Walk(node);
        }
Пример #11
0
 protected internal override bool Walk(BoundAssignment node) {
     node.Ref = GetOrMakeRef(node.Variable);
     return true;
 }
Пример #12
0
 internal override object EvaluateAssign(CodeContext context, object value)
 {
     return(BoundAssignment.EvaluateAssign(context, Variable, value));
 }
Пример #13
0
 // BoundAssignment
 private void Dump(BoundAssignment node)
 {
     Out("(.bound " + SymbolTable.IdToString(node.Variable.Name) + ") = ");
     WalkNode(node.Value);
 }