From 9f0d45d634ac38d54ed92c5726fbaed65850e15f Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 17 May 2000 12:14:05 +0000 Subject: [PATCH] Finished cleanng up mess: multiplication reinstalled. --- filter/filter.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/filter/filter.c b/filter/filter.c index 3a1ee074..dd370088 100644 --- a/filter/filter.c +++ b/filter/filter.c @@ -230,6 +230,22 @@ interpret(struct f_inst *what) default: runtime( "Usage of unknown type" ); } break; + case '-': + TWOARGS_C; + switch (res.type = v1.type) { + case T_VOID: runtime( "Can not operate with values of type void" ); + case T_INT: res.val.i = v1.val.i - v2.val.i; break; + default: runtime( "Usage of unknown type" ); + } + break; + case '*': + TWOARGS_C; + switch (res.type = v1.type) { + case T_VOID: runtime( "Can not operate with values of type void" ); + case T_INT: res.val.i = v1.val.i * v2.val.i; break; + default: runtime( "Usage of unknown type" ); + } + break; case '/': TWOARGS_C; switch (res.type = v1.type) { @@ -582,6 +598,8 @@ i_same(struct f_inst *f1, struct f_inst *f2) switch(f1->code) { case ',': /* fall through */ case '+': + case '-': + case '*': case '/': case P('!','='): case P('=','='):