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.7 1996/11/18 20:44:08 hubbe Exp $"); + RCSID("$Id: las.c,v 1.8 1996/11/25 21:33:08 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:308:   }      node *mkidentifiernode(int i)   {    node *res = mkemptynode();    res->token = F_IDENTIFIER;    setup_fake_program();    copy_shared_string(res->type, ID_FROM_INT(&fake_program, i)->type);       /* FIXME */ +  if(IDENTIFIER_IS_CONSTANT(ID_FROM_INT(&fake_program, i)->flags)) +  { +  res->node_info = OPT_EXTERNAL_DEPEND; +  }else{    res->node_info = OPT_NOT_CONST; -  +  }      #ifdef __CHECKER__    CDR(res)=0;   #endif    res->u.number = i;    return res;   }      node *mkcastnode(struct pike_string *type,node *n)   {
pike.git/src/las.c:960:    {    copy_shared_string(n->type,CAR(n)->type);    }else{    copy_shared_string(n->type,mixed_type_string);    }    break;       case F_ASSIGN:    if(CAR(n) && CDR(n) &&    !match_types(CDR(n)->type,CAR(n)->type)) -  my_yyerror("Bad type in assignment.\n"); +  my_yyerror("Bad type in assignment.");    copy_shared_string(n->type, CDR(n)->type);    break;       case F_INDEX:    type_a=CAR(n)->type;    type_b=CDR(n)->type;    if(!check_indexing(type_a, type_b))    my_yyerror("Indexing on illegal type.");    n->type=index_type(type_a);    break;
pike.git/src/las.c:986:    push_type(T_VOID); /* not varargs */    push_type(T_MANY);    low_build_function_type(CDR(n));    push_type(T_FUNCTION);    s=pop_type();       n->type=check_call(s,CAR(n)->type?CAR(n)->type:mixed_type_string);       if(!n->type)    { -  yyerror("Bad arguments to function call."); +  switch(CAR(n)->token) +  { +  case F_IDENTIFIER: +  setup_fake_program(); +  my_yyerror("Bad argument %d to '%s'.", +  max_correct_args+1, +  ID_FROM_INT(& fake_program, CAR(n)->u.number)->name->str); +  break; +  +  case F_CONSTANT: +  default: +  my_yyerror("Bad argument %d to function call.",max_correct_args+1); +  }    copy_shared_string(n->type, mixed_type_string);    }    free_string(s);    break;    }       case '?':    if(!match_types(CAR(n)->type,mixed_type_string))    yyerror("Bad conditional expression.\n");