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.122 1999/11/21 00:50:30 grubba Exp $"); + RCSID("$Id: las.c,v 1.123 1999/11/21 01:47:41 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:2139:       if(CADR(n)->type == CDDR(n)->type)    {    copy_shared_string(n->type,CADR(n)->type);    break;    }       n->type = or_pike_types(CADR(n)->type, CDDR(n)->type);    break;    +  case F_RANGE: +  case F_INC: +  case F_DEC: +  case F_POST_INC: +  case F_POST_DEC: +  if (CAR(n)) { +  /* The expression gets the type from the variable. */ +  /* FIXME: Ought to strip non-applicable subtypes from the type. */ +  copy_shared_string(n->type, CAR(n)->type); +  } else { +  copy_shared_string(n->type, mixed_type_string); +  } +  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 &&    CAR(n)->token == F_CONSTANT &&    IS_ZERO(& CAR(n)->u.sval)
pike.git/src/las.c:2222:       if(!CDR(n) || CDR(n)->type==void_type_string)    {    if(CAR(n))    copy_shared_string(n->type,CAR(n)->type);    else    copy_shared_string(n->type,void_type_string);    break;    }    +  case F_SSCANF: +  MAKE_CONSTANT_SHARED_STRING(n->type, tIntPos); +  break; +  +  case F_UNDEFINED: +  MAKE_CONSTANT_SHARED_STRING(n->type, tInt0); +  break; +  +  case F_AND_EQ: +  case F_OR_EQ: +  case F_XOR_EQ: +  case F_LSH_EQ: +  case F_RSH_EQ: +  case F_ADD_EQ: +  case F_SUB_EQ: +  case F_MULT_EQ: +  case F_MOD_EQ: +  case F_DIV_EQ: +  /* FIXME: Go via var = OP(var, expr); to get the type? */ +  /* FALL_THROUGH */ +  case F_MAGIC_INDEX: +  case F_MAGIC_SET_INDEX: +  case F_CATCH: +  /* FIXME: FALL_THROUGH */    default:    copy_shared_string(n->type,mixed_type_string);    }       if (n->type != old_type) {    if (n->parent) {    n->parent->node_info |= OPT_TYPE_NOT_FIXED;    }    }    if (old_type) {