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.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"   #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:2152:    push_finished_type(n->type);    }else{    push_type(T_MIXED);    }    }   }      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)   {    struct pike_string *type_a,*type_b;    struct pike_string *old_type;       if (n->type && !(n->node_info & OPT_TYPE_NOT_FIXED))    return; /* assume it is correct */       old_type = n->type;
pike.git/src/las.c:2460:    !(    compiler_frame->current_return_type==void_type_string &&    CAR(n)->token == F_CONSTANT &&    IS_ZERO(& CAR(n)->u.sval)    )    ) {    if (!match_types(compiler_frame->current_return_type,CAR(n)->type))    {    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)    {    yytype_error("Return type mismatch.",    compiler_frame->current_return_type,    CAR(n)->type,    YYTE_IS_WARNING);    }    }    }