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.41 1998/04/24 00:08:42 hubbe Exp $"); + RCSID("$Id: pike_types.c,v 1.42 1998/04/28 07:47:17 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:705:    t=low_describe_type(t);    my_strcat(" ...");    }    my_strcat(" : ");    t=low_describe_type(t);    my_strcat(")");    break;    }       case T_ARRAY: +  my_strcat("array");    if(EXTRACT_UCHAR(t)==T_MIXED)    { -  my_strcat("array"); +     t++;    }else{ -  +  my_strcat("(");    t=low_describe_type(t); -  my_strcat("*"); +  my_strcat(")");    }    break;       case T_MULTISET:    my_strcat("multiset");    if(EXTRACT_UCHAR(t)!=T_MIXED)    {    my_strcat("(");    t=low_describe_type(t);    my_strcat(")");
pike.git/src/pike_types.c:889:    p=id_to_program(EXTRACT_INT(t+2));    if(!p) return 0;    i=FIND_LFUN(p, lfun);    if(i==-1) return 0;    return ID_FROM_INT(p, i)->type;   }      #define A_EXACT 1   #define B_EXACT 2   #define NO_MAX_ARGS 4 + #define NO_SHORTCUTS 8      /*    * match two type strings, return zero if they don't match, and return    * the part of 'a' that _did_ match if it did.    */   static char *low_match_types(char *a,char *b, int flags)   {    int correct_args;    char *ret;    if(a == b) return a;
pike.git/src/pike_types.c:912:    case T_AND:    a++;    ret=low_match_types(a,b,flags);    if(!ret) return 0;    a+=type_length(a);    return low_match_types(a,b,flags);       case T_OR:    a++;    ret=low_match_types(a,b,flags); -  if(ret) return ret; +  if(ret && !(flags & NO_SHORTCUTS)) return ret;    a+=type_length(a); -  +  if(ret) +  { +  low_match_types(a,b,flags); +  return ret; +  }else{    return low_match_types(a,b,flags); -  +  }       case T_NOT:    if(low_match_types(a+1,b,(flags ^ B_EXACT ) | NO_MAX_ARGS))    return 0;    return a;       case T_ASSIGN:    ret=low_match_types(a+2,b,flags);    if(ret && EXTRACT_UCHAR(b)!=T_VOID)    {
pike.git/src/pike_types.c:956:    case T_AND:    b++;    ret=low_match_types(a,b,flags);    if(!ret) return 0;    b+=type_length(b);    return low_match_types(a,b,flags);       case T_OR:    b++;    ret=low_match_types(a,b,flags); -  if(ret) return ret; +  if(ret && !(flags & NO_SHORTCUTS)) return ret;    b+=type_length(b); -  +  if(ret) +  { +  low_match_types(a,b,flags); +  return ret; +  }else{    return low_match_types(a,b,flags); -  +  }       case T_NOT:    if(low_match_types(a,b+1, (flags ^ A_EXACT ) | NO_MAX_ARGS))    return 0;    return a;       case T_ASSIGN:    ret=low_match_types(a,b+2,flags);    if(ret && EXTRACT_UCHAR(a)!=T_VOID)    {
pike.git/src/pike_types.c:1186:    return low_get_return_type(a+type_length(a),b);       case T_ARRAY:    a++;    tmp=low_get_return_type(a,b);    if(!tmp) return 0;    push_type(T_ARRAY);    return 1;    }    -  a=low_match_types(a,b,0); +  a=low_match_types(a,b,NO_SHORTCUTS);    if(a)    {    switch(EXTRACT_UCHAR(a))    {    case T_FUNCTION:    a++;    while(EXTRACT_UCHAR(a)!=T_MANY) a+=type_length(a);    a++;    a+=type_length(a);    push_unfinished_type_with_markers(a, a_markers );