--- parser3/src/main/execute.C 2001/07/13 12:15:51 1.178 +++ parser3/src/main/execute.C 2001/07/24 15:43:56 1.181 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: execute.C,v 1.178 2001/07/13 12:15:51 parser Exp $"; +static const char *RCSId="$Id: execute.C,v 1.181 2001/07/24 15:43:56 parser Exp $"; #include "pa_opcode.h" #include "pa_array.h" @@ -34,7 +34,7 @@ char *opcode_name[]={ // actions "WITH_SELF", "WITH_ROOT", "WITH_READ", "WITH_WRITE", "GET_CLASS", - "CONSTRUCT_VALUE", "CONSTRUCT_DOUBLE", + "CONSTRUCT_VALUE", "CONSTRUCT_EXPR", "WRITE_VALUE", "WRITE_EXPR_RESULT", "STRING__WRITE", "GET_ELEMENT", "GET_ELEMENT__WRITE", "CREATE_EWPOOL", "REDUCE_EWPOOL", @@ -69,7 +69,7 @@ void debug_printf(Pool& pool, const char } void debug_dump(Pool& pool, int level, const Array& ops) { - { +/* { int size=ops.quick_size(); //debug_printf(pool, "size=%d\n", size); for(int i=0; ijunction.self.get_class(); - // not ^name.method call and + // not ^name.method call, name:method call; and // is context object or class & is it my class or my parent's class and? VStateless_class *read_class=rcontext->get_class(); - if(!wcontext->somebody_entered_some_object() && + if( + !(wcontext->somebody_entered_some_object() && + !wcontext->somebody_entered_some_class()) && read_class && read_class->is_or_derived_from(*called_class)) // yes self=rcontext; // class dynamic call else // no, not me or relative of mine (total stranger) @@ -722,14 +724,14 @@ void Request::execute(const Array& ops) Value *Request::get_element() { const String& name=POP_NAME(); Value *ncontext=POP(); - Value *value; - if(Method* method=OP.get_method(name)) { // operator? - // as if that method were in self and we have normal dynamic method here - Junction& junction=*NEW Junction(pool(), - *self, self->get_class(), method, 0,0,0,0); - value=NEW VJunction(junction); - } else - value=ncontext->get_element(name); + Value *value=ncontext->get_element(name); + if(!value) + if(Method* method=OP.get_method(name)) { // maybe operator? + // as if that method were in self and we have normal dynamic method here + Junction& junction=*NEW Junction(pool(), + *self, self->get_class(), method, 0,0,0,0); + value=NEW VJunction(junction); + } if(value) value=&process(*value, &name); // process possible code-junction else { @@ -850,7 +852,7 @@ const String *Request::execute_nonvirtua const String& method_name, bool return_cstr) { if(const Method *method=aclass.get_method(method_name)) - return execute_method(aself, *method, return_cstr); + return execute_method(aclass, *method, return_cstr); return 0; }