Exemplo n.º 1
0
 internal RTExecutionError(RTScope func, RTErrorCode errCode, string errMsg)
     : base(func.Creator.SourceStartIndex, func.Creator.SourceEndIndex, errCode, errMsg)
 {
     this.FunctionName = func.FunctionName;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Deep copy this instance.
        /// </summary>
        /// <returns>A clone.</returns>
        private RTScope Duplicate()
        {
            RTScope scope = new RTScope();
            scope.Creator = this.Creator;
            scope._argCount = this._argCount;

            if (_slots != null)
                foreach (var pair in this._slots)
                {
                    scope.SetValueLocal(pair.Key, pair.Value);
                }
            return scope;
        }
Exemplo n.º 3
0
        public void PushScope(RTScope scope)
        {
            scope.Parent = CurrentScope;
            _scopes.Push(scope);
            _currentScope = scope;

            if (scope.Parent == null)
            {
                _rootScope = scope;
                InitRootScope();
            }
        }
Exemplo n.º 4
0
 public RTScope PopScope()
 {
     var scope = _scopes.Pop();
     _currentScope = scope.Parent;
     scope.Parent = null;
     return scope;
 }
Exemplo n.º 5
0
        public override object Execute(RTExecutionContext context)
        {
            var scope = new RTScope(this);
            var retval = scope.Execute(context);

            if (!Metadata.HasReturnValue)
            {
                retval = RTVoid.Singleton;
            }
            return retval;
        }