소스 검색

ncd: modules: call: Make inline_code::call take the arguments directly.

Ambroz Bizjak 11 년 전
부모
커밋
e5206baa26
2개의 변경된 파일2개의 추가작업 그리고 16개의 파일을 삭제
  1. 1 15
      ncd/modules/call2.c
  2. 1 1
      ncd/tests/call.ncd

+ 1 - 15
ncd/modules/call2.c

@@ -502,26 +502,12 @@ static void inline_code_die (void *vo)
 
 static void inline_code_call_new (void *vo, NCDModuleInst *i, const struct NCDModuleInst_new_params *params)
 {
-    NCDValRef args_arg;
-    if (!NCDVal_ListRead(params->args, 1, &args_arg)) {
-        ModuleLog(i, BLOG_ERROR, "wrong arity");
-        goto fail0;
-    }
-    if (!NCDVal_IsList(args_arg)) {
-        ModuleLog(i, BLOG_ERROR, "wrong type");
-        goto fail0;
-    }
-    
     struct inline_code_call *o = vo;
     
     o->ic = NCDModuleInst_Backend_GetUser((NCDModuleInst *)params->method_user);
     LinkedList0_Prepend(&o->ic->calls_list, &o->ic_node);
     
-    func_new_templ(vo, i, o->ic->template_name, args_arg, inline_code_call_process_getspecialobj, inline_code_extra_free);
-    return;
-    
-fail0:
-    NCDModuleInst_Backend_DeadError(i);
+    func_new_templ(vo, i, o->ic->template_name, params->args, inline_code_call_process_getspecialobj, inline_code_extra_free);
 }
 
 static void inline_code_extra_free (struct instance *bo)

+ 1 - 1
ncd/tests/call.ncd

@@ -11,7 +11,7 @@ process main {
         concat(foo, _scope.foo, _caller.bar, _arg0) x;
     } block;
     var("bar") bar;
-    block->call({"arg"}) c;
+    block->call("arg") c;
     val_equal(c.x, "foofoobararg") a;
     assert(a);