pike.git/
src/
cpp.cmod
Branch:
Tag:
Non-build tags
All tags
No tags
2018-07-08
2018-07-08 10:07:26 by Henrik Grubbström (Grubba) <grubba@grubba.org>
68a3f1cbf154b016771371d8e21102ff8357bf24 (
41
lines) (+
33
/-
8
)
[
Show
|
Annotate
]
Branch:
master
Cpp: Added resolv().
886:
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::
1439:
} 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 &&