Branch: Tag:

2008-05-30

2008-05-30 11:20:44 by Henrik Grubbström (Grubba) <grubba@grubba.org>

It is now possible to return a reference to the current inherit in this object.
The third argument to program_magic_identifier() should now be -1 when no inherit has been specified (0 is now reserved for referring to the current inherit).
This is also reflected in the F_THIS node.
The F_THIS opcode is now used exclusively to refer to specific inherits.
Use the F_THIS_OBJECT opcode to refer to the current object.

Rev: src/docode.c:1.201
Rev: src/interpret_functions.h:1.204
Rev: src/language.yacc:1.426
Rev: src/las.c:1.415
Rev: src/peep.in:1.83
Rev: src/program.c:1.710

2:   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: language.yacc,v 1.425 2008/05/24 15:14:12 grubba Exp $ + || $Id: language.yacc,v 1.426 2008/05/30 11:20:41 grubba Exp $   */      %pure_parser
3875:    {    /* done, nothing to do here */    }else if(!($$=find_module_identifier(Pike_compiler->last_identifier,1)) && -  !($$ = program_magic_identifier (Pike_compiler, 0, 0, +  !($$ = program_magic_identifier (Pike_compiler, 0, -1,    Pike_compiler->last_identifier, 0))) {    if((Pike_compiler->flags & COMPILATION_FORCE_RESOLVE) ||    (Pike_compiler->compiler_pass==2)) {
3952:    }    | inherit_specifier TOK_IDENTIFIER    { -  if ($1 >= 0) { +     int id;       if(Pike_compiler->last_identifier) free_string(Pike_compiler->last_identifier);
3981:    else {    if ((Pike_compiler->flags & COMPILATION_FORCE_RESOLVE) ||    (Pike_compiler->compiler_pass == 2)) { -  if (inherit_state->new_program->inherits[$1].name) { +  if (($1 >= 0) && inherit_state->new_program->inherits[$1].name) {    my_yyerror("Undefined identifier %S::%S.",    inherit_state->new_program->inherits[$1].name,    Pike_compiler->last_identifier);
3994:    else    $$=mknode(F_UNDEFINED,0,0);    } -  } else { -  $$=0; -  } +        free_node($2);    }