Finished cleanng up mess: multiplication reinstalled.

This commit is contained in:
Pavel Machek 2000-05-17 12:14:05 +00:00
parent 4ee2178935
commit 9f0d45d634

View file

@ -230,6 +230,22 @@ interpret(struct f_inst *what)
default: runtime( "Usage of unknown type" ); default: runtime( "Usage of unknown type" );
} }
break; 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 '/': case '/':
TWOARGS_C; TWOARGS_C;
switch (res.type = v1.type) { switch (res.type = v1.type) {
@ -582,6 +598,8 @@ i_same(struct f_inst *f1, struct f_inst *f2)
switch(f1->code) { switch(f1->code) {
case ',': /* fall through */ case ',': /* fall through */
case '+': case '+':
case '-':
case '*':
case '/': case '/':
case P('!','='): case P('!','='):
case P('=','='): case P('=','='):