--- parser3/src/main/execute.C 2009/08/11 10:19:02 1.356 +++ parser3/src/main/execute.C 2010/04/19 19:39:54 1.360 @@ -5,7 +5,7 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char * const IDENT_EXECUTE_C="$Date: 2009/08/11 10:19:02 $"; +static const char * const IDENT_EXECUTE_C="$Date: 2010/04/19 19:39:54 $"; #include "pa_opcode.h" #include "pa_array.h" @@ -272,11 +272,11 @@ void Request::execute(ArrayOperation& op debug_origin=i.next().origin; Value& value=*i.next().value; - const String& name=*value.get_string(); + const String& name=*value.get_string(); debug_name=&name; DEBUG_PRINT_STRING(name) - Value* class_value=classes().get(name); + Value* class_value=get_class(name); if(!class_value) throw Exception(PARSER_RUNTIME, &name, @@ -291,8 +291,8 @@ void Request::execute(ArrayOperation& op // maybe they do ^class:method[] call, remember the fact wcontext->set_somebody_entered_some_class(); - const String& name=stack.pop().string(); - Value* value=classes().get(name); + const String& name=stack.pop().string(); debug_name=&name; + Value* value=get_class(name); if(!value) throw Exception(PARSER_RUNTIME, &name, @@ -543,7 +543,7 @@ void Request::execute(ArrayOperation& op DEBUG_PRINT_STRING(var_name) - const String* field=get_element(*rcontext, var_name).get_string(); + const String* field=&get_element(*rcontext, var_name).as_string(); Value& value=get_element(object, *field); @@ -834,11 +834,11 @@ void Request::execute(ArrayOperation& op { debug_origin=i.next().origin; Value& vclass_name=*i.next().value; - const String& class_name=*vclass_name.get_string(); + const String& class_name=*vclass_name.get_string(); debug_name=&class_name; DEBUG_PRINT_STRING(class_name) - Value* class_value=classes().get(class_name); + Value* class_value=get_class(class_name); if(!class_value) throw Exception(PARSER_RUNTIME, &class_name, @@ -864,7 +864,7 @@ void Request::execute(ArrayOperation& op DEBUG_PRINT_STR("->\n") Junction casted=Junction(*class_value, junction->method); - VMethodFrame frame(casted, method_frame); + VConstructorFrame frame(casted, method_frame); METHOD_FRAME_ACTION(op_call(frame, true /* constructing */)); if(opcode==OP::OP_CONSTRUCT_OBJECT) @@ -1223,9 +1223,7 @@ void Request::op_call(VMethodFrame& fram "is not a constructor, system class '%s' can be constructed only implicitly", called_class.name().cstr()); - frame.write(*new_self, - String::L_CLEAN // not used, always an object, not string - ); + frame.write(*new_self); } else throw Exception(PARSER_RUNTIME, 0, //&frame.name(), @@ -1571,15 +1569,13 @@ const String* Request::execute_method(Va // prevent non-string writes for better error reporting if(do_return_string) - wcontext->write(local_frame); + local_frame.write(local_frame); // execute! execute(*method.parser_code); // result - const String* result=0; - if(do_return_string) - result=&wcontext->result().as_string(); + const String* result=do_return_string ? local_frame.get_string() : 0; RESTORE_CONTEXT