--- parser3/src/main/execute.C 2002/10/16 08:22:14 1.285 +++ parser3/src/main/execute.C 2002/10/31 10:29:23 1.289 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_EXECUTE_C="$Date: 2002/10/16 08:22:14 $"; +static const char* IDENT_EXECUTE_C="$Date: 2002/10/31 10:29:23 $"; #include "pa_opcode.h" #include "pa_array.h" @@ -177,6 +177,11 @@ void Request::execute(const Array& ops) } case OP_WITH_WRITE: { + if(wcontext==method_frame) + throw Exception("parser.runtime", + 0, + "$.name outside of $name[...]"); + PUSH(wcontext); break; } @@ -819,7 +824,7 @@ void Request::execute(const Array& ops) } } -/// @test cache|prepare junctions +/// @todo cache|prepare junctions Value *Request::get_element(const String *& remember_name, bool can_call_operator) { const String& name=POP_NAME(); remember_name=&name; Value *ncontext=POP(); @@ -841,13 +846,13 @@ Value *Request::get_element(const String if(Value *base_object=get_self()->base_object()) { // doing DYNAMIC call Temp_derived temp_derived(*base_object, 0); // temporarily prevent go-back-down virtual calls value=base_object->get_element(name, base_object, false); // virtual-up lookup starting from parent - goto _void; + goto value_ready; } } if(!value) value=ncontext->get_element(name, ncontext, false); -_void: +value_ready: if(value) value=&process_to_value(*value); // process possible code-junction else @@ -885,7 +890,6 @@ StringOrValue Request::process(Value& in Value *saved_rcontext=rcontext; WContext *saved_wcontext=wcontext; -//// self=&junction->self; method_frame=junction->method_frame; rcontext=junction->rcontext; @@ -936,7 +940,7 @@ const String& Request::execute_method(VM WContext *saved_wcontext=wcontext; // initialize contexts - /****self=*/rcontext=wcontext=method_frame=&amethod_frame; + rcontext=wcontext=method_frame=&amethod_frame; // execute! execute(*method.parser_code);