/// <summary> /// Queues a Coral function to run asynchronously. /// </summary> public static void CallFunction( State state, string name, object[] args, StackTrace.StackFrame frame ) { // Convert the arguments. AstNode[] wrapped = WrapArgs( args ); // Construct a synthetic AstIdentifier for the name. AstIdentifier id = new AstIdentifier( name ); // Construct a synthetic AstCall. AstCall call = new AstCall( id, wrapped, frame ); call.run( state ); }
/// <summary> /// Queues a Coral function to run asynchronously. /// </summary> public static void CallFunction( State state, FValue func, object[] args, StackTrace.StackFrame frame ) { // Convert the arguments. AstNode[] wrapped = WrapArgs( args ); // Construct a synthetic AstIdentifier for the name. AstNode funcNode = new WrapperAstObject( func ); // Construct a synthetic AstCall. AstCall call = new AstCall( funcNode, wrapped, frame ); call.run( state ); }
/// <summary> /// Pass in the state and the step just executed. We'll temporarily push it /// back on the stack to get a full trace. /// </summary> public void setStackTrace( State s ) { this.trace = s.getStackTrace(); setValue( "trace", new List<object>( this.trace.frames.Select( f => f.ToStringI() ) ) ); }
/// <summary> /// Calls a Coral function synchronously and returns its return value. /// </summary> public object callFunction( string name, object[] args, System.Type returnType, StackTrace.StackFrame frame ) { CallFunction( _state, name, args, frame ); runSync(); return Util.CoerceToDotNet( returnType, _state.popResult() ); }
public AstCall( AstNode source, AstNode[] parameters, StackTrace.StackFrame frame ) { this.source = source; this.parameters = parameters; this.frame = frame; }