Branch: Tag:

2002-05-11

2002-05-11 21:08:00 by Martin Stjernholm <mast@lysator.liu.se>

Cleaned up and fixed some bugs in the lookup of magic program identifiers
like this_program and ::`->. It's now possible to use e.g.
global::this_program. Added an optional level argument to this_object().

Added a magic identifier "this" that can be used instead of this_object().
Like this_program, it only exists when there's no other identifier with that
name. The object of a surrounding class can be adressed with Foo::this.

Rev: src/builtin_functions.c:1.428
Rev: src/interpret_functions.h:1.103
Rev: src/language.yacc:1.283
Rev: src/program.c:1.430
Rev: src/program.h:1.160

5:   \*/      /* -  * $Id: program.h,v 1.159 2002/05/10 15:31:43 grubba Exp $ +  * $Id: program.h,v 1.160 2002/05/11 21:08:00 mast Exp $    */   #ifndef PROGRAM_H   #define PROGRAM_H
153:   #define IDENTIFIER_C_FUNCTION 2   #define IDENTIFIER_FUNCTION 3   #define IDENTIFIER_CONSTANT 4 - #define IDENTIFIER_VARARGS 8 + #define IDENTIFIER_VARARGS 8 /* Used for functions only. */   #define IDENTIFIER_PROTOTYPED 16   #define IDENTIFIER_SCOPED 32 /* This is used for local functions only */   #define IDENTIFIER_SCOPE_USED 64 /* contains scoped local functions */
169:      /*    * Every constant, class, function and variable -  * get's exactly one of these. +  * gets exactly one of these.    */   struct identifier   {
455:   struct node_s *find_module_identifier(struct pike_string *ident,    int see_inherit);   struct node_s *resolve_identifier(struct pike_string *ident); + struct node_s *program_magic_identifier (struct program_state *state, +  int state_depth, int inherit_num, +  struct pike_string *ident, +  int colon_colon_ref);   struct program *parent_compilation(int level);   struct program *id_to_program(INT32 id);   void optimize_program(struct program *p);