pike.git
/
src
/
program.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/program.c:2093:
/** * This function is intended to simplify resolving of * program symbols during compile-time for C-modules. * * A typical use-case is for a C-module inheriting * code written in Pike. */ PMOD_EXPORT struct program *resolve_program(struct pike_string *ident) { struct program *ret = NULL;
-
struct
node
_
s *n =
resolve_identifier(ident)
;
-
if (n
) {
-
if ((
n->token
=
=
F
_
CONSTANT) && (TYPEOF(n->u.sval) == T
_
PROGRAM) &&
-
(
ret = n
-
>u.sval.u.program
)) {
+
if
(low
_resolve_identifier(ident)) {
+
if ((
ret
=
program
_
from_svalue
(
Pike_sp
-
1
))) {
add_ref(ret);
-
} else {
-
my_yyerror("Invalid program identifier '%S'.", ident);
+
}
-
free
_
node
(
n
);
-
} else {
-
my_yyerror("Unknown program identifier '%S'.", ident);
+
pop
_
stack
();
}
-
+
if (!ret) {
+
my_yyerror("Invalid program identifier '%S'.", ident);
+
}
return ret; } /** * Find the identifier named ident in inherit #inh in the lexical scope * given by inherit_state and inherit_depth. * * @param inherit_state * The program state for the program where the inherit is found. *