--- parser3/src/main/execute.C 2002/01/31 12:49:32 1.212 +++ parser3/src/main/execute.C 2002/01/31 15:16:01 1.214 @@ -4,7 +4,7 @@ Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://paf.design.ru) - $Id: execute.C,v 1.212 2002/01/31 12:49:32 paf Exp $ + $Id: execute.C,v 1.214 2002/01/31 15:16:01 paf Exp $ */ #include "pa_opcode.h" @@ -44,6 +44,7 @@ char *opcode_name[]={ "GET_METHOD_FRAME", "STORE_PARAM", "PREPARE_TO_CONSTRUCT_OBJECT", "CALL", + "PREPARE_TO_CONSTRUCT_EXPR" // expression ops: unary "NEG", "INV", "NOT", "DEF", "IN", "FEXISTS", "DEXISTS", @@ -216,6 +217,20 @@ void Request::execute(const Array& ops) wcontext->set_somebody_entered_some_class(false); break; } + case OP_PREPARE_TO_CONSTRUCT_EXPR: + { + // here, not in OP_CONSTRUCT_EXPR + // because then would be too late - expression already would try to evaluate + // in wrong state + // not the case with OP_CONSTRUCT_VALUE, there we have write pool + // (separate wcontext with it's own state + + // forget the fact they've entered some $class/object.xxx + // see OP_GET_ELEMENT + wcontext->set_somebody_entered_some_object(false); + wcontext->set_somebody_entered_some_class(false); + break; + } case OP_CONSTRUCT_EXPR: { value=POP(); @@ -224,7 +239,8 @@ void Request::execute(const Array& ops) ncontext->put_element(name, value->as_expr_result()); value->set_name(name); - // forget the fact they've entered some $class/object.xxx + // forget the fact that they've entered some ^class/object.xxx or $class/object.xxx + // during expression evaluation // see OP_GET_ELEMENT wcontext->set_somebody_entered_some_object(false); wcontext->set_somebody_entered_some_class(false); @@ -483,6 +499,11 @@ void Request::execute(const Array& ops) root=POP(); self=static_cast(POP()); + // forget the fact they've entered some ^object/class.xxx + // see OP_GET_ELEMENT + wcontext->set_somebody_entered_some_object(false); + wcontext->set_somebody_entered_some_class(false); + PUSH(value); #ifdef DEBUG_EXECUTE debug_printf(pool(), "<-returned");