pike.git / src / pike_types.c

version» Context lines:

pike.git/src/pike_types.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: pike_types.c,v 1.324 2008/05/03 20:06:07 grubba Exp $ + || $Id: pike_types.c,v 1.325 2008/05/04 14:04:11 grubba Exp $   */      #include "global.h"   #include <ctype.h>   #include "svalue.h"   #include "pike_types.h"   #include "stralloc.h"   #include "stuff.h"   #include "array.h"   #include "program.h"
pike.git/src/pike_types.c:5710:    INT32 flags,    struct svalue *sval   #ifdef PIKE_TYPE_DEBUG    , INT32 indent   #define CHECK_CALL_ARGS , indent+1   #else   #define CHECK_CALL_ARGS   #endif /* PIKE_TYPE_DEBUG */    )   { +  struct compilation *c = MAYBE_THIS_COMPILATION;    struct pike_type *res = NULL;    struct pike_type *tmp;    struct pike_type *tmp2;    INT32 array_cnt = 0;      #ifdef PIKE_DEBUG    if (l_flag>2) {    fprintf(stderr, "%*slower_new_check_call(", indent*2, "");    simple_describe_type(fun_type);    fprintf(stderr, ", ");
pike.git/src/pike_types.c:5742:    switch(fun_type->type) {    case T_SCOPE:    /* FIXME: Save and restore the corresponding marker set. */    case T_ASSIGN:    case PIKE_T_NAME:    fun_type = fun_type->cdr;    goto loop;       case PIKE_T_ATTRIBUTE:    res = lower_new_check_call(fun_type->cdr, arg_type, flags, sval CHECK_CALL_ARGS); +  if (!res) return NULL; +  if (c) { +  ref_push_string((struct pike_string *)fun_type->car); +  ref_push_type_value(fun_type->cdr); +  ref_push_type_value(arg_type); +  safe_apply_current2(PC_APPLY_TYPE_ATTRIBUTE_FUN_NUM, 3, +  "apply_type_attribute"); +  if ((Pike_sp[-1].type == T_INT) && +  (Pike_sp[-1].subtype == NUMBER_NUMBER) && +  (!Pike_sp[-1].u.integer)) { +  pop_stack(); +  free_type(res); +  return NULL; +  } +  pop_stack(); +  }    type_stack_mark();    push_finished_type(res);    push_type_attribute((struct pike_string *)fun_type->car);    free_type(res);    return pop_unfinished_type();       case T_OR:    res = lower_new_check_call(fun_type->car, arg_type, flags, sval CHECK_CALL_ARGS);    if (!res) {    res = lower_new_check_call(fun_type->cdr, arg_type, flags, sval CHECK_CALL_ARGS);
pike.git/src/pike_types.c:5958:       if ((Pike_compiler->compiler_pass == 2) && sval) {    while (tmp2->type == PIKE_T_NAME) {    tmp2 = tmp2->cdr;    }       if (tmp2->type == PIKE_T_ATTRIBUTE) {    struct compilation *c = MAYBE_THIS_COMPILATION;    /* Perform extra argument checking based on the attribute. */    /* FIXME: Support multiple attributes. */ +  /* FIXME: Ought to use PikeCompiler! */    ref_push_string((struct pike_string *)tmp2->car);    push_svalue(sval);    ref_push_type_value(tmp2->cdr);    ref_push_type_value(res);    if (safe_apply_handler("handle_attribute_constant",    c?c->handler:NULL,    c?c->compat_handler:NULL, 4, 0)) {    if ((Pike_sp[-1].type == PIKE_T_TYPE)) {    type_stack_mark();    push_finished_type(Pike_sp[-1].u.type);
pike.git/src/pike_types.c:6067:       loop:    clear_markers();    /* First split the argument type into basic types. */    switch(arg_type->type) {    case T_ASSIGN:    case PIKE_T_NAME:    arg_type = arg_type->cdr;    goto loop;    +  /* FIXME: PIKE_T_ATTRIBUTE's ought to propagate out to the basic types. +  */ +     case T_OR:    if (!(tmp = low_new_check_call(fun_type, arg_type->car, flags, sval))) {    if (flags & CALL_STRICT) {    return NULL;    }    arg_type = arg_type->cdr;    goto loop;    }    if (!(tmp2 = low_new_check_call(fun_type, arg_type->cdr, flags, sval))) {    if (flags & CALL_STRICT) {