pike.git / src / cpp.cmod

version» Context lines:

pike.git/src/cpp.cmod:879:    this->compat_handler=Pike_sp[-1].u.object;    dmalloc_touch_svalue(Pike_sp-1);    Pike_sp--;    } else {    pop_stack();    }    this->compat_major=major;    this->compat_minor=minor;   }    + /*! @decl mixed resolv(string sym) +  *! +  *! Attempt to resolve a symbol. +  *! +  *! The default implementation calls @[CompilerEnvironment()->resolv()] +  *! in the parent object, with the remaining arguments taken from the +  *! current @[CPP] context. +  *! +  *! @returns +  *! Returns the value of @[sym] if found, and @[UNDEFINED] if not. +  */ + PIKEFUN mixed resolv(string sym) + { +  struct CPP_struct *this = THIS; +  +  ref_push_string(sym); +  ref_push_string(this->current_file); +  if (this->handler) { +  ref_push_object(this->handler); +  } else { +  push_undefined(); +  } +  if (this->compat_handler) { +  ref_push_object(this->compat_handler); +  } else { +  push_undefined(); +  } +  +  apply_external(1, CE_RESOLV_FUN_NUM, 4); + } +    /* #if macros and functions. */      /*! @namespace cpp::    *!    *! Pike has a builtin C-style preprocessor. It works similar to the    *! ANSI-C preprocessor but has a few extra features. These and the    *! default set of preprocessor macros are described here.    */      /*! @directive #!
pike.git/src/cpp.cmod:1432:    struct pike_string *str = arr->item[0].u.string;    struct svalue *sv;    if((sv=low_mapping_string_lookup(get_builtin_constants(), str)))    {    /* efun */    push_svalue(sv);    res=1;    } else if(get_master()) {    /* Module. */    ref_push_string(str); -  ref_push_string(this->current_file); -  if (this->handler) { -  ref_push_object(this->handler); -  } else { -  push_int(0); -  } +     -  if (safe_apply_handler("resolv", this->handler, -  this->compat_handler, 3, 0)) { +  if (safe_apply_current(f_CPP_resolv_fun_num, 1)) {    if ((TYPEOF(Pike_sp[-1]) == T_OBJECT &&    Pike_sp[-1].u.object == placeholder_object) ||    (TYPEOF(Pike_sp[-1]) == T_PROGRAM &&    Pike_sp[-1].u.program == placeholder_program)) {    cpp_error_sprintf (this, "Got placeholder %s (resolver problem) "    "when resolving %S.",    get_name_of_type(TYPEOF(Pike_sp[-1])),    str);    }    else