diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-05-17 12:14:05 +0000 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-05-17 12:14:05 +0000 |
commit | 9f0d45d634ac38d54ed92c5726fbaed65850e15f (patch) | |
tree | e5223c3034ff1ea7678994b6cb2b2eb36e00c50b /filter | |
parent | 4ee2178935b1f4cdd465e290c13f6580901cec8d (diff) |
Finished cleanng up mess: multiplication reinstalled.
Diffstat (limited to 'filter')
-rw-r--r-- | filter/filter.c | 18 |
1 files changed, 18 insertions, 0 deletions
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('=','='): |