--- parser3/src/main/execute.C 2001/03/08 15:20:46 1.75 +++ parser3/src/main/execute.C 2001/03/08 17:14:53 1.78 @@ -1,5 +1,5 @@ /* - $Id: execute.C,v 1.75 2001/03/08 15:20:46 paf Exp $ + $Id: execute.C,v 1.78 2001/03/08 17:14:53 paf Exp $ */ #include "pa_array.h" @@ -281,7 +281,7 @@ void Request::execute(const Array& ops) else // no, not me or relative of mine (total stranger) if(wcontext->constructing()) { // constructing? // yes, constructor call: $some(^class:method(..)) - self=NEW VObject(pool(), *called_class); + self=NEW VObject(*called_class); frame->write(*self); } else self=&frame->junction.self; // no, static or simple dynamic call @@ -316,7 +316,8 @@ void Request::execute(const Array& ops) case OP_NEG: { Value *operand=POP(); - Value *value=NEW VDouble(pool(), -operand->get_double()); + Value *value=NEW VDouble(pool(), + -operand->get_double()); PUSH(value); break; } @@ -361,28 +362,32 @@ void Request::execute(const Array& ops) case OP_SUB: { Value *b=POP(); Value *a=POP(); - Value *value=NEW VDouble(pool(), a->get_double() - b->get_double()); + Value *value=NEW VDouble(pool(), + a->get_double() - b->get_double()); PUSH(value); break; } case OP_ADD: { Value *b=POP(); Value *a=POP(); - Value *value=NEW VDouble(pool(), a->get_double() + b->get_double()); + Value *value=NEW VDouble(pool(), + a->get_double() + b->get_double()); PUSH(value); break; } case OP_MUL: { Value *b=POP(); Value *a=POP(); - Value *value=NEW VDouble(pool(), a->get_double() * b->get_double()); + Value *value=NEW VDouble(pool(), + a->get_double() * b->get_double()); PUSH(value); break; } case OP_DIV: { Value *b=POP(); Value *a=POP(); - Value *value=NEW VDouble(pool(), a->get_double() / b->get_double()); + Value *value=NEW VDouble(pool(), + a->get_double() / b->get_double()); PUSH(value); break; } @@ -542,10 +547,13 @@ Value *Request::get_element() { Value *ncontext=POP(); Value *value=ncontext->get_element(name); - // autocalc possible code-junction - value=value?&autocalc(*value):NEW VUnknown(pool()); + if(value) + value=&autocalc(*value); // autocalc possible code-junction + else { + value=NEW VUnknown(pool()); + value->set_name(name); + } - value->set_name(name); return value; }