pike.git / src / pike_compiler.cmod

version» Context lines:

pike.git/src/pike_compiler.cmod:2268:    yytype_report(REPORT_WARNING, NULL, 0, NULL,    NULL, 0, NULL,    1, "Using deprecated %O value.");    }    }    pop_n_elems(args);    push_int(1);   }      /*! @decl int(0..1) apply_type_attribute(string attribute, @ -  *! type a, type|void b) +  *! type a, type|zero b, @ +  *! mapping|void state) +  *! @decl int(0..1) apply_type_attribute(string attribute, type a)    *!    *! Type attribute handler.    *!    *! @param attribute    *! Attribute that @[a] had.    *!    *! @param a    *! Type of the value being called.    *!    *! @param b
pike.git/src/pike_compiler.cmod:2290:    *! @[UNDEFINED] if no more arguments.    *!    *! Called during type checking when @[a] has been successfully    *! had a partial evaluation with the argument @[b] and    *! @[a] had the type attribute @[attribute] before the    *! evaluation.    *!    *! The default implementation implements the "deprecated"    *! attribute.    *! +  *! @param state +  *! Mapping intended to hold state during checking of multiple +  *! arguments. +  *!    *! @returns    *! Returns @expr{1@} if the type check should be allowed    *! (ie @expr{__attribute__(attribute, a)(b)@}) is valid,    *! and @expr{0@} (zero) otherwise.    *!    *! @seealso    *! @[pop_type_attribute()], @[push_type_attribute()]    */   static void f_compilation_apply_type_attribute(INT32 args)   {    struct pike_string *attr;    struct svalue *a, *b = NULL;    struct compilation *c = THIS_COMPILATION;    struct pike_string *deprecated_string; -  +  struct mapping *state = NULL;    -  get_all_args(NULL, args, "%W%*.%*", &attr, &a, &b); +  get_all_args(NULL, args, "%W%*.%*%m", &attr, &a, &b, &state);       if (Pike_compiler->compiler_pass == COMPILER_PASS_LAST) {    MAKE_CONST_STRING(deprecated_string, "deprecated");    if ((attr == deprecated_string) &&    !(c->lex.pragmas & ID_NO_DEPRECATION_WARNINGS) &&    (!b ||    ((TYPEOF(*b) == T_INT) && (SUBTYPEOF(*b) == NUMBER_UNDEFINED) &&    (!b->u.integer)))) {    /* push_svalue(a); */    yytype_report(REPORT_WARNING, NULL, 0, NULL,
pike.git/src/pike_compiler.cmod:2327:    0, "Calling a deprecated value.");    }    }    pop_n_elems(args);    push_int(1);   }      /*! @decl type(mixed) apply_attribute_constant(string attr, @    *! mixed value, @    *! type arg_type, @ -  *! void cont_type) +  *! void cont_type, @ +  *! mapping state)    *!    *! Handle constant arguments to attributed function argument types.    *!    *! @param attr    *! Attribute that @[arg_type] had.    *!    *! @param value    *! Constant value sent as parameter.    *!    *! @param arg_type
pike.git/src/pike_compiler.cmod:2355:    *! successfully matched against @[arg_type],    *! and @[arg_type] had the type attribute @[attr].    *!    *! This function is typically used to perform specialized    *! argument checking and to allow for a strengthening    *! of the function type based on @[value].    *!    *! The default implementation implements the @expr{"sprintf_format"@},    *! @expr{"sscanf_format"@} and @expr{"sscanf_76_format"@} attributes.    *! +  *! @param state +  *! Mapping intended to hold state during checking of multiple +  *! arguments. +  *!    *! @returns    *! Returns a continuation type if it succeeded in strengthening the type.    *!    *! Returns @tt{UNDEFINED@} otherwise (this is not an error indication).    *!    *! @seealso    *! @[pop_type_attribute()], @[push_type_attribute()]    */   static void f_compilation_apply_attribute_constant(INT32 args)   {
pike.git/src/pike_compiler.cmod:2952:    ADD_FUNCTION("pop_type_attribute", f_compilation_pop_type_attribute,    tFunc(tStr tType(tMix) tType(tMix), tInt01), 0);       ADD_FUNCTION("push_type_attribute", f_compilation_push_type_attribute,    tFunc(tStr tType(tMix) tType(tMix), tInt01), 0);       ADD_FUNCTION("index_type_attribute", f_compilation_index_type_attribute,    tFunc(tStr tType(tMix) tType(tMix), tInt01), 0);       ADD_FUNCTION("apply_type_attribute", f_compilation_apply_type_attribute, -  tFunc(tStr tType(tMix) tOr(tType(tMix), tVoid), tInt01), 0); +  tFunc(tStr tType(tMix) tOr(tType(tMix), tZero) tMapping, +  tInt01), 0);       ADD_FUNCTION("apply_attribute_constant",    f_compilation_apply_attribute_constant, -  tFunc(tStr tMix tType(tMix) tType(tFunction), +  tFunc(tStr tMix tType(tMix) tType(tFunction) tMapping,    tType(tFunction)), 0);       ADD_FUNCTION("_sprintf", f_compilation__sprintf,    tFunc(tInt tOr(tMap(tStr, tMix), tVoid), tStr), ID_PROTECTED);       ADD_FUNCTION("suppress_deprecation_warnings",    f_compilation_suppress_deprecation_warnings,    tFunc(tVoid, tInt), 0);       start_new_program();