Branch: Tag:

2020-01-11

2020-01-11 14:56:48 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler: Improved handling output from {simple,low}_describe_type().

{simple,low}_describe_type() now display the length type for
array and string types if it is other than the default.

2084:    {    INT32 min;    INT32 max; -  s = s->cdr; +     fprintf(stderr, "string"); -  if (s != int_type_string) { +  if ((s->car == int_pos_type_string) && (s->cdr == int_type_string)) { +  break; +  }    fprintf(stderr, "("); -  +  if (s->car != int_pos_type_string) { +  simple_describe_type(s->car); +  fprintf(stderr, ": "); +  } +  s = s->cdr; +  if (s != int_type_string) {    while (s->type == T_OR) {    struct pike_type *char_type = s->car;    while(char_type->type == T_ASSIGN) {
2168:    }    }    } -  fprintf(stderr, ")"); +     } -  +  fprintf(stderr, ")");    break;    }    case T_TYPE:
2212:    break;    case T_ARRAY:    fprintf(stderr, "array("); +  if (s->car != int_pos_type_string) { +  simple_describe_type(s->car); +  fprintf(stderr, ":"); +  }    simple_describe_type(s->cdr);    fprintf(stderr, ")");    break;
2404:    case T_STRING:    {    string_builder_strcat(s, "string"); -  if (t->cdr == int_type_string) { +  if ((t->cdr == int_type_string) && (t->car == int_pos_type_string)) {    break;    }    string_builder_putchar(s, '('); -  +  if (t->car != int_pos_type_string) { +  low_describe_int_range(s, t->car); +  string_builder_strcat(s, ": "); +  }    low_describe_int_range(s, t->cdr);    string_builder_putchar(s, ')');    break;
2482:       case T_ARRAY:    string_builder_strcat(s, "array"); -  if(t->cdr->type == T_MIXED) { +  if((t->cdr->type == T_MIXED) || (t->car == int_pos_type_string)) {    break;    }    string_builder_putchar(s, '('); -  +  if (t->car != int_pos_type_string) { +  low_describe_int_range(s, t->car); +  string_builder_putchar(s, ':'); +  if (t->cdr->type != T_MIXED) { +  string_builder_putchar(s, ' '); +  } +  } +  if (t->cdr->type != T_MIXED) {    string_builder_sprintf(s, "%T", t->cdr); -  +  }    string_builder_putchar(s, ')');    break;