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.121 1999/11/20 21:16:39 grubba Exp $"); + RCSID("$Id: las.c,v 1.122 1999/11/21 00:50:30 grubba 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:1997:    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)    {    copy_shared_string(n->type,CAR(n)->type);    }else{ -  /* FIXME: Shouldn't it be an or? */ -  copy_shared_string(n->type,mixed_type_string); +  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.");    copy_shared_string(n->type, void_type_string);    break;    } else if(CAR(n) && CDR(n)) {    fix_type_field(CAR(n));    fix_type_field(CDR(n));    /* a["b"]=c and a->b=c can be valid when a is an array */    if (CDR(n)->token != F_INDEX && CDR(n)->token != F_ARROW &&    !match_types(CDR(n)->type,CAR(n)->type)) {    my_yyerror("Bad type in assignment.");    }    } -  copy_shared_string(n->type, CAR(n)->type); +  n->type = and_pike_types(CAR(n)->type, CDR(n)->type);    break;       case F_INDEX:    case F_ARROW:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    my_yyerror("Indexing a void expression.");    /* The optimizer converts this to an expression returning 0. */    copy_shared_string(n->type, mixed_type_string);    } else {    type_a=CAR(n)->type;
pike.git/src/las.c:2137:    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;    }    -  /* FIXME: Should be type_a|type_b */ -  copy_shared_string(n->type,mixed_type_string); +  n->type = or_pike_types(CADR(n)->type, CDDR(n)->type);    break;       case F_RETURN:    if (!CAR(n) || (CAR(n)->type == void_type_string)) {    yyerror("Returning a void expression.");    } else if(compiler_frame &&    compiler_frame->current_return_type &&    !match_types(compiler_frame->current_return_type,CAR(n)->type) &&    !(    compiler_frame->current_return_type==void_type_string &&