--- parser3/src/main/execute.C 2001/06/29 14:16:09 1.171 +++ parser3/src/main/execute.C 2001/07/13 12:15:51 1.178 @@ -5,7 +5,7 @@ Author: Alexander Petrosyan (http://design.ru/paf) */ -static const char *RCSId="$Id: execute.C,v 1.171 2001/06/29 14:16:09 parser Exp $"; +static const char *RCSId="$Id: execute.C,v 1.178 2001/07/13 12:15:51 parser Exp $"; #include "pa_opcode.h" #include "pa_array.h" @@ -253,6 +253,7 @@ void Request::execute(const Array& ops) // maybe they do ^object.method[] call, remember the fact wcontext->inc_somebody_entered_some_object(); + //_asm int 3; Value *value=get_element(); PUSH(value); break; @@ -537,7 +538,7 @@ void Request::execute(const Array& ops) const String *problem_source=&b->as_string(); #ifndef NO_STRING_ORIGIN if(!problem_source->origin().file) - problem_source=b->name(); + problem_source=&b->name(); #endif THROW(0, 0, problem_source, @@ -552,21 +553,21 @@ void Request::execute(const Array& ops) { Value *b=POP(); Value *a=POP(); - int a_int=a->as_int(); - int b_int=b->as_int(); + double a_double=a->as_double(); + double b_double=b->as_double(); - if(b_int == 0) { + if(b_double == 0) { const String *problem_source=&b->as_string(); #ifndef NO_STRING_ORIGIN if(!problem_source->origin().file) - problem_source=b->name(); + problem_source=&b->name(); #endif THROW(0, 0, problem_source, "Modulus by zero"); } - Value *value=NEW VDouble(pool(), a_int % b_int); + Value *value=NEW VDouble(pool(), fmod(a_double, b_double)); PUSH(value); break; } @@ -804,7 +805,8 @@ Value& Request::process(Value& value, co return *result; } -const String *Request::execute_method(Value& aself, const Method& method, bool return_cstr) { +const String *Request::execute_method(Value& aself, const Method& method, + bool return_cstr) { PUSH(self); PUSH(root); PUSH(rcontext); @@ -833,8 +835,9 @@ const String *Request::execute_method(Va return result; } -const String *Request::execute_method(Value& aself, - const String& method_name, bool return_cstr) { +const String *Request::execute_virtual_method(Value& aself, + const String& method_name, + bool return_cstr) { if(Value *value=aself.get_element(method_name)) if(Junction *junction=value->get_junction()) if(const Method *method=junction->method) @@ -842,3 +845,12 @@ const String *Request::execute_method(Va return 0; } + +const String *Request::execute_nonvirtual_method(VStateless_class& aclass, + const String& method_name, + bool return_cstr) { + if(const Method *method=aclass.get_method(method_name)) + return execute_method(aself, *method, return_cstr); + + return 0; +}