Example #1
0
 // BoundAssignment
 private void DefaultWalk(BoundAssignment node)
 {
     if (Walk(node))
     {
         WalkNode(node.Value);
     }
     PostWalk(node);
 }
Example #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);
            }
        }
Example #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);
        }
Example #4
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return(true);
 }
Example #5
0
 protected internal override bool Walk(BoundAssignment node)
 {
     node.Ref = Reference(node.Variable);
     return true;
 }
Example #6
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return false;
 }
Example #7
0
 // BoundAssignment
 protected internal override bool Walk(BoundAssignment node)
 {
     WalkNode(node.Value);
     Define(node.Variable);
     return(false);
 }
Example #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);
        }
Example #11
0
 protected internal override bool Walk(BoundAssignment node) {
     node.Ref = GetOrMakeRef(node.Variable);
     return true;
 }
Example #12
0
 internal override object EvaluateAssign(CodeContext context, object value)
 {
     return(BoundAssignment.EvaluateAssign(context, Variable, value));
 }
Example #13
0
 // BoundAssignment
 private void Dump(BoundAssignment node)
 {
     Out("(.bound " + SymbolTable.IdToString(node.Variable.Name) + ") = ");
     WalkNode(node.Value);
 }