pike.git / src / las.c

version» Context lines:

pike.git/src/las.c:1:   /*\   ||| This file a part of Pike, and is copyright by Fredrik Hubinette   ||| Pike is distributed as GPL (General Public License)   ||| See the files COPYING and DISCLAIMER for more information.   \*/   /**/   #include "global.h" - RCSID("$Id: las.c,v 1.131 1999/11/24 21:41:44 hubbe Exp $"); + RCSID("$Id: las.c,v 1.132 1999/11/25 00:56:23 hubbe Exp $");      #include "language.h"   #include "interpret.h"   #include "las.h"   #include "array.h"   #include "object.h"   #include "stralloc.h"   #include "dynamic_buffer.h"   #include "lex.h"   #include "pike_types.h"
pike.git/src/las.c:2014:   }      static int function_type_max=0;      static void low_build_function_type(node *n)   {    if(!n) return;    if(function_type_max++ > 999)    {    reset_type_stack(); +     push_type(T_MIXED); -  push_type(T_MIXED); /* is varargs */ +  push_type(T_VOID); +  push_type(T_OR); /* return type is void or mixed */ +  +  push_type(T_MIXED); +  push_type(T_VOID); +  push_type(T_OR); /* varargs */ +     push_type(T_MANY);    return;    }    switch(n->token)    {    case F_COMMA_EXPR:    case F_ARG_LIST:    low_build_function_type(CDR(n));    low_build_function_type(CAR(n));    break;       case F_PUSH_ARRAY: /* We let this ruin type-checking for now.. */    reset_type_stack(); -  +     push_type(T_MIXED); -  push_type(T_MIXED); /* is varargs */ +  push_type(T_VOID); +  push_type(T_OR); /* return type is void or mixed */ +  +  push_type(T_MIXED); +  push_type(T_VOID); +  push_type(T_OR); /* varargs */ +     push_type(T_MANY);    return;       default:    if(n->type)    {    if(n->type == void_type_string) return;    push_finished_type(n->type);    }else{    push_type(T_MIXED);
pike.git/src/las.c:2167:       case F_APPLY:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Calling a void expression.");    } else {    struct pike_string *s;    struct pike_string *f;    char *name;    INT32 max_args,args;    -  push_type(T_MIXED); /* match any return type, even void */ +  push_type(T_MIXED); /* match any return type */ +  push_type(T_VOID); /* even void */ +  push_type(T_OR); +     push_type(T_VOID); /* not varargs */    push_type(T_MANY);    function_type_max=0;    low_build_function_type(CDR(n));    push_type(T_FUNCTION);    s = pop_type();    f = CAR(n)->type?CAR(n)->type:mixed_type_string;    n->type = check_call(s,f);    args = count_arguments(s);    max_args = count_arguments(f);