Branch: Tag:

2000-03-17

2000-03-17 05:13:17 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

better error messages (I hope)

Rev: src/builtin_functions.c:1.244
Rev: src/las.c:1.170
Rev: src/pike_types.c:1.127
Rev: src/pike_types.h:1.37
Rev: src/program.c:1.213
Rev: src/program.h:1.83

5:   \*/   /**/   #include "global.h" - RCSID("$Id: program.c,v 1.212 2000/03/10 20:08:54 hubbe Exp $"); + RCSID("$Id: program.c,v 1.213 2000/03/17 05:13:17 hubbe Exp $");   #include "program.h"   #include "object.h"   #include "dynamic_buffer.h"
3891:   }      /* returns 1 if a implements b */ - int yyexplain_not_implements(struct program *a, struct program *b) + int yyexplain_not_implements(struct program *a, struct program *b, int flags)   {    int e;    struct pike_string *s=findstring("__INIT");
3907:    if (i == -1) {    if (b->identifier_references[e].id_flags & (ID_OPTIONAL))    continue; /* It's ok... */ +  if(flags & YYTE_IS_WARNING) +  yywarning("Missing identifier \"%s\".", bid->name->str); +  else    my_yyerror("Missing identifier \"%s\".", bid->name->str);    return 0;    }
3916:    my_yyerror("Type of identifier dentifier \"%s\" does not match.", bid->name->str);    s1=describe_type(ID_FROM_INT(a,i)->type);    s2=describe_type(bid->type); +  if(flags & YYTE_IS_WARNING) +  { +  yywarning("Expected: %s",s1->str); +  yywarning("Got : %s",s2->str); +  }else{    my_yyerror("Expected: %s",s1->str);    my_yyerror("Got : %s",s2->str); -  +  } +     free_string(s1);    free_string(s2);    return 0;