Branch: Tag:

1995-10-20

1995-10-20 08:43:12 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

committing

Rev: src/language.y:1.5
Rev: src/las.c:1.4
Rev: src/lex.c:1.4
Rev: src/lex.h:1.3
Rev: src/lpc_types.c:1.5
Rev: src/program.c:1.5
Rev: src/stralloc.c:1.4
Rev: src/svalue.h:1.3

32:    * they are coded like this:    * T_FUNCTION <arg type> <arg type> ... <arg type> T_MANY <arg type> <return type>    * note that the type after T_MANY can be T_VOID -  * T_TRUE matches anything +     * T_MIXED matches anything except T_VOID    * T_UNKNOWN only matches T_MIXED and T_UNKNOWN    */
94:    case T_PROGRAM:    case T_MIXED:    case T_VOID: -  case T_TRUE: +     case T_UNKNOWN:    break;    }
173:    ++*s;    type_stack_reverse();    }else{ -  push_type(T_TRUE); +     push_type(T_MIXED); -  +  push_type(T_MIXED);    push_type(T_MANY);    }    push_type(T_FUNCTION);
280: Inside #if defined(DEBUG)
   case T_LIST: printf("list"); break;       case T_UNKNOWN: printf("unknown"); break; -  case T_TRUE: printf("true"); break; +     case T_MANY: printf("many"); break;    case T_OR: printf("or"); break;    case T_VOID: printf("void"); break;
291: Inside #if defined(DEBUG)
   }    printf("\n");   } +  + void simple_describe_type(struct lpc_string *s) + { +  stupid_describe_type(s->str,s->len); + }   #endif      char *low_describe_type(char *t)
305:    my_strcat("mixed");    break;    -  case T_TRUE: -  my_strcat("true"); -  break; -  +     case T_UNKNOWN:    my_strcat("unknown");    break;
395:    {    case T_OR:    case T_MANY: -  case T_TRUE: +     case T_UNKNOWN:    return T_MIXED;   
431:    return low_match_types(a,b);    }    -  if(EXTRACT_UCHAR(a)==T_TRUE) return a; -  if(EXTRACT_UCHAR(b)==T_TRUE) return a; -  -  /* 'mixed' matches anything except 'void' */ -  if(EXTRACT_UCHAR(a) == T_MIXED && EXTRACT_UCHAR(b) != T_VOID) return a; -  if(EXTRACT_UCHAR(b) == T_MIXED && EXTRACT_UCHAR(a) != T_VOID) return a; +  /* 'mixed' matches anything */ +  if(EXTRACT_UCHAR(a) == T_MIXED) return a; +  if(EXTRACT_UCHAR(b) == T_MIXED) return a;    if(EXTRACT_UCHAR(a) != EXTRACT_UCHAR(b)) return 0;       ret=a;
458:       if(EXTRACT_UCHAR(b)==T_MANY)    { -  b_tmp=a+1; +  b_tmp=b+1;    }else{    b_tmp=b;    b+=type_length(b);
469:    /* check the 'many' type */    a++;    b++; -  if(EXTRACT_UCHAR(b)==T_VOID) +  if(EXTRACT_UCHAR(b)==T_VOID || EXTRACT_UCHAR(a)==T_VOID)    { -  b++; +     a+=type_length(a); -  +  b+=type_length(b);    }else{    if(!low_match_types(a,b)) return 0;    }
496:    case T_PROGRAM:    case T_VOID:    case T_MIXED: -  case T_TRUE: +     break;    -  +     default:    fatal("error in type string.\n");    }