Branch: Tag:

2022-03-03

2022-03-03 10:52:00 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Clean up describing of some types.

2824:       case T_ARRAY:    string_builder_strcat(s, "array"); -  if (t->cdr && (t->cdr->type == T_MIXED) && -  (t->car == int_pos_type_string)) { +  if ((t->cdr == mixed_type_string) && (t->car == int_pos_type_string)) {    break;    }    string_builder_putchar(s, '('); -  if (t->car != int_pos_type_string) { +     if (t->car == zero_type_string) {    /* Zero-length array. */ -  string_builder_strcat(s, "zero"); +  string_builder_strcat(s, "zero:");    } else { -  +  if (t->car != int_pos_type_string) {    low_describe_int_range(s, t->car); -  } +     string_builder_putchar(s, ':'); -  if (t->cdr->type != T_MIXED) { +  if (t->cdr != mixed_type_string) {    string_builder_putchar(s, ' ');    }    } -  if (t->cdr && (t->cdr->type != T_MIXED)) { +  if (t->cdr != mixed_type_string) {    string_builder_sprintf(s, "%T", t->cdr);    } -  +  }    string_builder_putchar(s, ')');    break;       case T_MULTISET: -  if(t->car && (t->car->type != T_MIXED)) { +  if(t->car != mixed_type_string) {    string_builder_sprintf(s, "multiset(%T)", t->car);    } else {    string_builder_strcat(s, "multiset");
2897:    break;       case T_MAPPING: -  if((t->car && (t->car->type != T_MIXED)) || -  (t->cdr && (t->cdr->type != T_MIXED))) { +  if ((t->car != mixed_type_string) || (t->cdr != mixed_type_string)) {    string_builder_sprintf(s, "mapping(%T:%T)", t->car, t->cdr);    } else {    string_builder_strcat(s, "mapping");