diff options
Diffstat (limited to 'filter/config.Y')
-rw-r--r-- | filter/config.Y | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/filter/config.Y b/filter/config.Y index c1e74531..cc19cac0 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -819,10 +819,17 @@ function_call: SYM '(' var_list ')' { struct symbol *sym; struct f_inst *inst = $3; - if ($1->class != SYM_FUNCTION) - cf_error("You can't call something which is not a function. Really."); + enum f_instruction_code code; + switch ($1->class) { + case SYM_FUNCTION: + code = FI_CALL; break; + case SYM_FUNCTION_NATIVE: + code = FI_CALL_NATIVE; break; + default: + cf_error("You can't call something which is not a function. Really."); + } DBG("You are calling function %s\n", $1->name); - $$ = f_new_inst(FI_CALL); + $$ = f_new_inst(code); $$->a1.p = inst; $$->a2.p = $1->def; sym = $1->aux2; @@ -939,10 +946,17 @@ term: | SYM '(' var_list ')' { struct symbol *sym; struct f_inst *inst = $3; - if ($1->class != SYM_FUNCTION) - cf_error("You can't call something which is not a function. Really."); + enum f_instruction_code code; + switch ($1->class) { + case SYM_FUNCTION: + code = FI_CALL; break; + case SYM_FUNCTION_NATIVE: + code = FI_CALL_NATIVE; break; + default: + cf_error("You can't call something which is not a function. Really."); + } DBG("You are calling function %s\n", $1->name); - $$ = f_new_inst(FI_CALL); + $$ = f_new_inst(code); $$->a1.p = inst; $$->a2.p = $1->def; sym = $1->aux2; |