diff options
author | Pavel Machek <pavel@ucw.cz> | 2000-05-17 14:14:05 +0200 |
---|---|---|
committer | Pavel Machek <pavel@ucw.cz> | 2000-05-17 14:14:05 +0200 |
commit | 9f0d45d634ac38d54ed92c5726fbaed65850e15f (patch) | |
tree | e5223c3034ff1ea7678994b6cb2b2eb36e00c50b /filter | |
parent | 4ee2178935b1f4cdd465e290c13f6580901cec8d (diff) | |
download | bird-9f0d45d634ac38d54ed92c5726fbaed65850e15f.tar bird-9f0d45d634ac38d54ed92c5726fbaed65850e15f.zip |
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 3a1ee07..dd37008 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('=','='): |