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.51 1998/02/23 23:24:02 hubbe Exp $"); + RCSID("$Id: las.c,v 1.52 1998/02/24 23:01:29 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:1427:    INT32 max_args,args;    push_type(T_MIXED); /* match any return type, even void */    push_type(T_VOID); /* not varargs */    push_type(T_MANY);    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=get_max_args(f); +  max_args=count_arguments(f); +  if(max_args<0) max_args=0x7fffffff;       if(!n->type)    {    char *name; -  int args; +     switch(CAR(n)->token)    {    case F_IDENTIFIER:    name=ID_FROM_INT(new_program, CAR(n)->u.number)->name->str;    break;       case F_CONSTANT:    switch(CAR(n)->u.sval.type)    {    case T_FUNCTION:
pike.git/src/las.c:1472:    break;    }    break;       default:    name="unknown function";    }       if(max_args < args)    { -  my_yyerror("To many arguments to %s.\n",name); +  my_yyerror("Too many arguments to %s. (%d %d)\n",name,max_args,args);    }    else if(max_correct_args == args)    {    my_yyerror("To few arguments to %s.\n",name);    }else{    my_yyerror("Bad argument %d to %s.",    max_correct_args+1, name);    }    copy_shared_string(n->type, mixed_type_string);    }