pike.git / src / pike_types.cmod

version» Context lines:

pike.git/src/pike_types.cmod:278:    * FUNCTION type FUNCTION|MANY    * MANY many type return type    * RING type type Reserved.    * TUPLE type type Reserved.    * MAPPING index type value type    * OR type (not OR) type    * AND type type    * ARRAY len type type len added in 8.1    * MULTISET type -    * NOT type - -  * '0'-'9' - - +  * '0'-'9' - - Marker $0-$9.    * FLOAT - -    * STRING len type ZERO, INT or OR len:8.1, Range:7.7    * TYPE type -    * PROGRAM type -    * MIXED - -    * VOID - -    * ZERO - -    * UNKNOWN - -    * INT min (int) max (int)    * OBJECT implements/is object id(int)
pike.git/src/pike_types.cmod:1400:    } else {    push_finished_type(type);    }    return;    }    if ((type->type >= '0') && (type->type <= '9')) {    /* Marker. */    unsigned int m = type->type - '0';   #ifdef PIKE_TYPE_DEBUG    if ((l_flag > 2) && m) { -  fprintf(stderr, "Marker %d: %p.\n", m, markers[m]); +  fprintf(stderr, "Marker $%d: %p.\n", m, markers[m]);    }   #endif /* PIKE_TYPE_DEBUG */    if (markers[m]) {    /* The marker has a value. */    struct pike_type *type = dmalloc_touch(struct pike_type *, markers[m]);   #ifdef PIKE_TYPE_DEBUG    if (l_flag > 2) {    fprintf(stderr, "Marker value.\n");    }   #endif
pike.git/src/pike_types.cmod:1447:    } else if (!markers[m]) {    push_type(PIKE_T_UNKNOWN);    }    TYPE_STACK_DEBUG("push_finished_type_with_markers");    return;    } else if (type->type == T_ASSIGN) {    /* Assign. */    int marker = PTR_TO_INT(type->car);   #ifdef PIKE_TYPE_DEBUG    if (l_flag > 2) { -  fprintf(stderr, "Assign to marker %"PRINTPTRDIFFT"d.\n", +  fprintf(stderr, "Assign to marker $%"PRINTPTRDIFFT"d.\n",    CAR_TO_INT(type));    }   #endif /* PIKE_TYPE_DEBUG */    if (marker_set & (PT_FLAG_ASSIGN_0 << marker)) {    /* The assignment should be kept as-is. */   #ifdef PIKE_TYPE_DEBUG    if (l_flag > 2) {    fprintf(stderr, "Keep assignment.\n");    }   #endif /* PIKE_TYPE_DEBUG */
pike.git/src/pike_types.cmod:2239:   void stupid_describe_type_string(char *a, ptrdiff_t len)   {    ptrdiff_t e;    for(e=0;e<len;e++)    {    if(e) fprintf(stderr, " ");    switch(EXTRACT_UCHAR(a+e))    {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9': -  fprintf(stderr, "%c",EXTRACT_UCHAR(a+e)); +  fprintf(stderr, "$%c",EXTRACT_UCHAR(a+e));    break;       case T_SCOPE: fprintf(stderr, "scope"); break;    case T_TUPLE: fprintf(stderr, "tuple"); break;    case T_ASSIGN: fprintf(stderr, "="); break;    case T_INT:    {    INT32 min=extract_type_int(a+e+1);    INT32 max=extract_type_int(a+e+1+sizeof(INT32));    fprintf(stderr, "int");
pike.git/src/pike_types.cmod:2330:    if (BEGIN_CYCLIC(s, NULL)) {    Pike_fatal("Circular type!\n");    }    SET_CYCLIC_RET(1);       if (s) {    /* fprintf(stderr, "[[[%p]]]", s); */    switch(s->type & PIKE_T_MASK) {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9': -  fprintf(stderr, "%d", s->type-'0'); +  fprintf(stderr, "$%d", s->type-'0');    break;       case PIKE_T_NAME:    fprintf(stderr, "{ %s = ", ((struct pike_string *)s->car)->str);    simple_describe_type(s->cdr);    fprintf(stderr, " }");    break;       case PIKE_T_ATTRIBUTE:    {
pike.git/src/pike_types.cmod:2367:    fprintf(stderr, ")");    break;    case T_TUPLE:    fprintf(stderr, "tuple(");    simple_describe_type(s->car);    fprintf(stderr, ", ");    simple_describe_type(s->cdr);    fprintf(stderr, ")");    break;    case T_ASSIGN: -  fprintf(stderr, "(%"PRINTPTRDIFFT"d = ", CAR_TO_INT(s)); +  fprintf(stderr, "($%"PRINTPTRDIFFT"d = ", CAR_TO_INT(s));    simple_describe_type(s->cdr);    fprintf(stderr, ")");    break;    case T_INT:    {    INT32 min = CAR_TO_INT(s);    INT32 max = CDR_TO_INT(s);    fprintf(stderr, "int");    if(min!=MIN_INT32 || max!=MAX_INT32) {    if (!min && max && !(max & (max+1))) {
pike.git/src/pike_types.cmod:2687:    } else {    string_builder_strcat(s, "..");    }    if (max != MAX_INT32) {    string_builder_sprintf(s, "%ld", (long)max);    }    }    }    break;    case T_ASSIGN: -  string_builder_sprintf(s, "%ld = (", CAR_TO_INT(t)); +  string_builder_sprintf(s, "$%ld = (", CAR_TO_INT(t));    low_describe_int_range(s, t->cdr);    string_builder_strcat(s, ")");    break;    case T_OR:    low_describe_int_range(s, t->car);    string_builder_strcat(s, " | ");    t = t->cdr;    goto loop;    default:    low_describe_type(s, t);
pike.git/src/pike_types.cmod:2713:   {    check_c_stack(1024);    if (!t) {    string_builder_strcat(s, "__unknown__");    return;    }    switch(t->type) /* NB: No masking here! */    {    case '0': case '1': case '2': case '3': case '4':    case '5': case '6': case '7': case '8': case '9': +  string_builder_putchar(s, '$');    string_builder_putchar(s, t->type);    break;       case T_ASSIGN: -  string_builder_sprintf(s, "(%c=%T)", '0' + CAR_TO_INT(t), t->cdr); +  string_builder_sprintf(s, "($%c=%T)", '0' + CAR_TO_INT(t), t->cdr);    break;       case T_SCOPE:    string_builder_sprintf(s, "scope(%c,%T)", '0' + CAR_TO_INT(t), t->cdr);    break;       case T_TUPLE:    string_builder_sprintf(s, "[%T,%T]", t->car, t->cdr);    break;   
pike.git/src/pike_types.cmod:7509:    return a;       case T_ASSIGN:    {    int m = CAR_TO_INT(a);    ret = low_match_types(a->cdr, b, flags);    if(ret && (!a_markers[m] || b->type != T_VOID))    {   #ifdef PIKE_DEBUG    if ((m < 0) || (m > 9)) { -  Pike_fatal("marker out of range: %d\n", m); +  Pike_fatal("marker out of range: $%d\n", m);    }   #endif /* PIKE_DEBUG */       type_stack_mark();    push_finished_type_with_markers(b, b_markers, 0);    tmp = pop_unfinished_type();       type_stack_mark();    low_or_pike_types(a_markers[m], tmp, 0);    if(a_markers[m]) free_type(a_markers[m]);
pike.git/src/pike_types.cmod:13056:    type ^= MIN_REF_TYPE;    }       switch(type) {   #ifdef PIKE_DEBUG    case T_SCOPE:    Pike_fatal("Not supported yet.\n");   #endif    case T_ASSIGN:    if ((type_string[1] < '0') || (type_string[1] > '9')) { -  Pike_fatal("low_make_pike_type(): Bad marker: %d\n", type_string[1]); +  Pike_fatal("low_make_pike_type(): Bad marker: $%d\n", type_string[1]);    }    low_make_pike_type(type_string+2, cont);    push_assign_type(type_string[1]);    break;    case T_OR:    case T_AND:    /* Order independant */    /* FALLTHRU */       case T_MANY: