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.157 1999/12/30 22:20:56 grubba Exp $"); + RCSID("$Id: las.c,v 1.158 2000/01/04 00:49:52 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:2453:    }    else if (lex.pragmas & ID_STRICT_TYPES)    {    yytype_error("Return type mismatch.",    compiler_frame->current_return_type,    CAR(n)->type,    YYTE_IS_WARNING);    }    }    } +  copy_shared_string(n->type,void_type_string); +  break;    -  /* Fall through */ -  +  case F_CASE: +  if (CDR(n) && CAR(n)) { +  /* case 1 .. 2: */ +  if (!match_types(CAR(n)->type, CDR(n)->type)) { +  yytype_error("Type mismatch in case range.", +  CAR(n)->type, CDR(n)->type, 0); +  } else if ((lex.pragmas & ID_STRICT_TYPES) && +  (CAR(n)->type != CDR(n)->type)) { +  /* The type should be the same for both CAR & CDR. */ +  if (!pike_types_le(CDR(n)->type, CAR(n)->type)) { +  yytype_error("Type mismatch in case range.", +  CAR(n)->type, CDR(n)->type, YYTE_IS_WARNING); +  } else if (!pike_types_le(CAR(n)->type, CDR(n)->type)) { +  yytype_error("Type mismatch in case range.", +  CDR(n)->type, CAR(n)->type, YYTE_IS_WARNING); +  } +  } +  } +  /* FALL_THROUGH */    case F_INC_LOOP:    case F_DEC_LOOP:    case F_DEC_NEQ_LOOP:    case F_INC_NEQ_LOOP: -  case F_CASE: +     case F_CONTINUE:    case F_BREAK:    case F_DEFAULT:    case F_POP_VALUE:    copy_shared_string(n->type,void_type_string);    break;       case F_DO:    if (!CDR(n) || (CDR(n)->type == void_type_string)) {    yyerror("do - while(): Conditional expression is void.");