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.132 1999/11/25 00:56:23 hubbe Exp $"); + RCSID("$Id: las.c,v 1.133 1999/12/03 02:42:30 mast 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:2093:    }    }    /* FALL_THROUGH */    case F_CAST:    /* Type-field is correct by definition. */    copy_shared_string(n->type, old_type);    break;       case F_LAND:    case F_LOR: -  if (!CAR(n) || CAR(n)->type == void_type_string || -  !CDR(n) || CDR(n)->type == void_type_string) { -  yyerror("Conditional contains void expression."); +  if (!CAR(n) || CAR(n)->type == void_type_string) { +  yyerror("Conditional uses void expression.");    copy_shared_string(n->type, mixed_type_string);    break;    }    if(!match_types(CAR(n)->type,mixed_type_string))    yyerror("Bad conditional expression.");    -  if(!match_types(CDR(n)->type,mixed_type_string)) -  yyerror("Bad conditional expression."); -  -  if(CAR(n)->type == CDR(n)->type) +  if (!CDR(n) || CDR(n)->type == void_type_string) +  copy_shared_string(n->type,void_type_string); +  else if(CAR(n)->type == CDR(n)->type)    {    copy_shared_string(n->type,CAR(n)->type);    }else{    n->type = or_pike_types(CAR(n)->type, CDR(n)->type);    }    break;       case F_ASSIGN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Assigning a void expression.");
pike.git/src/las.c:2276:    }    copy_shared_string(n->type, mixed_type_string);    break;       case '?':    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Conditional expression is void.");    } else if(!match_types(CAR(n)->type,mixed_type_string))    yyerror("Bad conditional expression.");    -  if(!CDR(n) || !CADR(n) || !CDDR(n)) +  if(!CDR(n) || !CADR(n) || !CDDR(n) || +  CADR(n)->type == void_type_string || +  CDDR(n)->type == void_type_string)    {    copy_shared_string(n->type,void_type_string);    break;    }       if(CADR(n)->type == CDDR(n)->type)    {    copy_shared_string(n->type,CADR(n)->type);    break;    }