diff --git a/src/language.yacc b/src/language.yacc index 73506a45d606fc39c5de98c23fae0db3d0eda1fa..4aedcebed514ccca12127e281a8d2b2795cf0d42 100644 --- a/src/language.yacc +++ b/src/language.yacc @@ -188,7 +188,7 @@ /* This is the grammar definition of Pike. */ #include "global.h" -RCSID("$Id: language.yacc,v 1.168 2000/03/07 21:22:34 hubbe Exp $"); +RCSID("$Id: language.yacc,v 1.169 2000/03/09 15:02:26 grubba Exp $"); #ifdef HAVE_MEMORY_H #include <memory.h> #endif @@ -2352,13 +2352,7 @@ low_idents: F_IDENTIFIER if(last_identifier) free_string(last_identifier); copy_shared_string(last_identifier, $1->u.sval.u.string); - if(last_identifier == this_program_string) { - struct svalue s; - s.type=T_PROGRAM; - s.u.program=new_program; - $$=mkconstantsvaluenode(&s); - } - else if(($$=lexical_islocal(last_identifier))) + if(($$=lexical_islocal(last_identifier))) { /* done, nothing to do here */ }else if((i=isidentifier(last_identifier))>=0){ diff --git a/src/program.c b/src/program.c index c9d596ef07ee44fc18742610e96d388aa67aff1d..4c6fb042b3147bf0169000505d68009c0743a47e 100644 --- a/src/program.c +++ b/src/program.c @@ -5,7 +5,7 @@ \*/ /**/ #include "global.h" -RCSID("$Id: program.c,v 1.209 2000/03/07 08:13:18 hubbe Exp $"); +RCSID("$Id: program.c,v 1.210 2000/03/09 15:02:27 grubba Exp $"); #include "program.h" #include "object.h" #include "dynamic_buffer.h" @@ -437,6 +437,14 @@ struct node_s *find_module_identifier(struct pike_string *ident) if(ret) return ret; } + /* Handle this_program */ + if (ident == this_program_string) { + struct svalue s; + s.type=T_PROGRAM; + s.u.program=new_program; + return mkconstantsvaluenode(&s); + } + return 0; }