pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.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: pike_types.c,v 1.145 2000/12/05 21:08:20 per Exp $"); + RCSID("$Id: pike_types.c,v 1.146 2001/02/09 10:29:54 hubbe Exp $");   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"   #include "constants.h"   #include "object.h"   #include "multiset.h"
pike.git/src/pike_types.c:3497:       if(implements_a && implements_b)    yyexplain_not_implements(implements_a,implements_b,flags);   }         struct pike_string *make_pike_type(char *t)   {    return make_shared_binary_string(t, type_length(t));   } +  +  + int pike_type_allow_premature_toss(char *type) + { +  again: +  switch(EXTRACT_UCHAR(type++)) +  { +  case T_NOT: +  return !pike_type_allow_premature_toss(type); +  +  case T_OBJECT: +  case T_MIXED: +  case T_FUNCTION: +  return 0; +  +  case T_SCOPE: +  case T_ASSIGN: +  type++; +  goto again; +  +  case T_OR: +  case T_MAPPING: +  if(!pike_type_allow_premature_toss(type)) return 0; +  case T_AND: +  type+=type_length(type); +  case T_ARRAY: +  case T_MULTISET: +  goto again; +  +  case T_PROGRAM: +  case T_INT: +  case T_FLOAT: +  case T_STRING: +  return 1; +  } + }