pike.git / src / program.c

version» Context lines:

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.    *