diff options
Diffstat (limited to 'src/program.c')
-rw-r--r-- | src/program.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/program.c b/src/program.c index 2c856e1b..aa3730df 100644 --- a/src/program.c +++ b/src/program.c @@ -217,56 +217,6 @@ void colm_run_program( Program *prg, int argc, const char **argv ) prg->argv = 0; } -Tree *colm_run_func( struct colm_program *prg, int frameId, - const char **params, int paramCount ) -{ - /* Make the arguments available to the program. */ - prg->argc = 0; - prg->argv = 0; - - Execution execution; - memset( &execution, 0, sizeof(execution) ); - - Tree **sp = prg->stackRoot; - - FrameInfo *fi = &prg->rtd->frameInfo[frameId]; - Code *code = fi->codeWC; - long stretch = fi->argSize + 4 + fi->frameSize; - vm_contiguous( stretch ); - - int p; - for ( p = 0; p < paramCount; p++ ) { - if ( params[p] == 0 ) { - vm_push_tree( 0 ); - } - else { - Head *head = stringAllocPointer( prg, params[p], strlen(params[p]) ); - Tree *tree = constructString( prg, head ); - treeUpref( tree ); - vm_push_tree( tree ); - } - } - - /* Set up the stack as if we have called. We allow a return value. */ - vm_push_tree( 0 ); - vm_push_tree( 0 ); - vm_push_tree( 0 ); - vm_push_tree( 0 ); - - execution.framePtr = vm_ptop(); - execution.frameId = frameId; - - /* Execution loop. */ - sp = colm_execute_code( prg, &execution, sp, code ); - - treeDownref( prg, sp, prg->returnVal ); - prg->returnVal = vm_pop_tree(); - - assert( sp == prg->stackRoot ); - - return prg->returnVal; -}; - static void colm_clear_heap( Program *prg, Tree **sp ) { struct colm_struct *hi = prg->heap.head; |