pike.git / src / program.c

version» Context lines:

pike.git/src/program.c:2032:    * =0 this_program:: or this::.    * -1 global::    * -2 ::    */   struct node_s *find_inherited_identifier(struct program_state *inherit_state,    int inherit_depth, int inh,    struct pike_string *ident)   {    int id;    -  if (inh < -1) { +  if (inh == INHERIT_ALL) {    /* Unspecified inherit, but not inherit #0. */    struct node_s *res = NULL;    struct program *p = inherit_state->new_program;    for (inh = 1; inh < p->num_inherits; inh++) {    struct node_s *n;    if (p->inherits[inh].inherit_level != 1) continue;    /* NB: We can't recurse here, as that would resolve the magic    * identifiers multiple times on multiple inherit.    */    id = low_reference_inherited_identifier(inherit_state, inh, ident,
pike.git/src/program.c:2214:    /* Found! */    name = id->name;    break;    }    if (!name) {    yyerror("Failed to find current class in its parent.");    return NULL;    }       /* Find ::name in the parent. */ -  n = find_inherited_identifier(state->previous, state_depth+1, -2, -  name); +  n = find_inherited_identifier(state->previous, state_depth+1, +  INHERIT_ALL, name);    if (!n) {    my_yyerror("Failed to find previous inherited definition of %S "    "in parent.", name);    return NULL;    }    } else {    n = mkefuncallnode("object_program",    mkthisnode(state->new_program, inherit_num));    }    /* We know this expression is constant. */
pike.git/src/program.c:2238:    return n;    }       /* Handle this_function */    if (ident == this_function_string) {    int i;    if ((i = Pike_compiler->compiler_frame->current_function_number) >= 0) {    struct identifier *id;    id = ID_FROM_INT(Pike_compiler->new_program, i);    if (colon_colon_ref) { -  if (inherit_num == -1) inherit_num = -2; +  if (inherit_num == -1) inherit_num = INHERIT_ALL;    return find_inherited_identifier(state, state_depth, inherit_num,    id->name);    }    if (id->identifier_flags & IDENTIFIER_SCOPED) {    return mktrampolinenode(i, Pike_compiler->compiler_frame->previous);    } else {    return mkidentifiernode(i);    }    } else {    /* FIXME: Fall back to __INIT? */