fixed the "!" operation

This commit is contained in:
afonya2 2025-05-30 22:09:13 +02:00
parent 0c60e98d9f
commit e9d1f9bbd6
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
3 changed files with 34 additions and 18 deletions

View file

@ -222,6 +222,11 @@ fn do_ast_op(ast_op: ASTPart, op_count: &mut usize, ops: &mut Vec<Operation>, va
">=" => 21,
"<" => 22,
"<=" => 23,
"!" => {
ops.push(Operation { opcode: 24, arg1: Some(left_reg), arg2: Some(reg.register as i64), arg3: None });
set_register(registers, RegisterState { id: reg.register, used: true, variable: 0, last_used: *op_count });
return reg.register;
},
_ => panic!("Unknown operator {}", op.operator),
};
ops.push(Operation { opcode, arg1: Some(left_reg), arg2: Some(right_reg as i64), arg3: Some(reg.register) });