protected override object DoEvaluate(ScriptThread thread) { thread.CurrentNode = this; //standard prolog lock (LockObject) { if (DependentScopeInfo == null) base.DependentScopeInfo = new ScopeInfo(this, _languageCaseSensitive); // In the first evaluation the parameter list will add parameter's SlotInfo objects to Scope.ScopeInfo thread.PushScope(DependentScopeInfo, null); Parameters.Evaluate(thread); thread.PopScope(); //Set Evaluate method and invoke it later this.Evaluate = EvaluateAfter; } var result = Evaluate(thread); thread.CurrentNode = Parent; //standard epilog return result; }
public object Call(ScriptThread thread, object[] parameters) { var astNode = new AstNode(); // TODO: figure it out var newScopeInfo = new ScopeInfo(astNode, thread.App.Language.Grammar.CaseSensitive); thread.PushScope(newScopeInfo, parameters); try { var expression = parameters != null && parameters.Length > 0 ? parameters[0] as PassiveExpression : null; return Function(expression); } finally { thread.PopScope(); } }
public override object Call(ScriptThread thread, object[] parameters) { thread.PushScope(ScopeInfo, parameters); try { var expression = parameters != null && parameters.Length > 0 ? parameters[0] as PassiveExpression : null; Block.InputExpression = expression; Block.BlockPattern = null; return Block.Evaluate(thread); } finally { thread.PopScope(); } }