summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2000-05-17 14:14:05 +0200
committerPavel Machek <pavel@ucw.cz>2000-05-17 14:14:05 +0200
commit9f0d45d634ac38d54ed92c5726fbaed65850e15f (patch)
treee5223c3034ff1ea7678994b6cb2b2eb36e00c50b
parent4ee2178935b1f4cdd465e290c13f6580901cec8d (diff)
downloadbird-9f0d45d634ac38d54ed92c5726fbaed65850e15f.tar
bird-9f0d45d634ac38d54ed92c5726fbaed65850e15f.zip
Finished cleanng up mess: multiplication reinstalled.
-rw-r--r--filter/filter.c18
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('=','='):