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: las.c,v 1.169 2000/03/13 20:54:49 grubba Exp $"); + RCSID("$Id: las.c,v 1.170 2000/03/17 05:13:17 hubbe Exp $");      #include "language.h"   #include "interpret.h"
2159:   void yytype_error(char *msg, struct pike_string *expected_t,    struct pike_string *got_t, unsigned int flags)   { -  struct pike_string *expected = describe_type(expected_t); -  struct pike_string *got = describe_type(got_t); -  -  if (flags & YYTE_IS_WARNING) { -  if (msg) { +  if (msg) +  { +  if (flags & YYTE_IS_WARNING)    yywarning("%s", msg); -  } -  yywarning("Expected: %s", expected->str); -  yywarning("Got : %s", got->str); -  } else { -  if (msg) { +  else    my_yyerror("%s", msg);    } -  my_yyerror("Expected: %s", expected->str); -  my_yyerror("Got : %s", got->str); +  +  yyexplain_nonmatching_types(expected_t, got_t, flags);   } -  free_string(got); -  free_string(expected); - } +       void fix_type_field(node *n)   {
2467:    {    yyerror("Wrong return type.");    yyexplain_nonmatching_types(compiler_frame->current_return_type, -  CAR(n)->type); +  CAR(n)->type,0);    }    else if (lex.pragmas & ID_STRICT_TYPES)    {