mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 15:08:52 +00:00
Update IR interpreter
This commit is contained in:
@@ -611,8 +611,8 @@ mod calculator {
|
|||||||
rhs: Value,
|
rhs: Value,
|
||||||
) -> Result<Value, ()> {
|
) -> Result<Value, ()> {
|
||||||
match (lhs, rhs) {
|
match (lhs, rhs) {
|
||||||
(Value::Undef { .. }, _) => Err(()),
|
(Value::Undef { dtype }, _) => Ok(Value::undef(dtype)),
|
||||||
(_, Value::Undef { .. }) => Err(()),
|
(_, Value::Undef { dtype }) => Ok(Value::undef(dtype)),
|
||||||
(
|
(
|
||||||
Value::Int {
|
Value::Int {
|
||||||
value: lhs,
|
value: lhs,
|
||||||
@@ -688,7 +688,7 @@ mod calculator {
|
|||||||
operand: Value,
|
operand: Value,
|
||||||
) -> Result<Value, ()> {
|
) -> Result<Value, ()> {
|
||||||
match operand {
|
match operand {
|
||||||
Value::Undef { .. } => Err(()),
|
Value::Undef { dtype } => Ok(Value::undef(dtype)),
|
||||||
Value::Int {
|
Value::Int {
|
||||||
value,
|
value,
|
||||||
width,
|
width,
|
||||||
@@ -741,7 +741,7 @@ mod calculator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match (value, dtype) {
|
match (value, dtype) {
|
||||||
(Value::Undef { .. }, _) => Err(()),
|
(Value::Undef { .. }, dtype) => Ok(Value::undef(dtype)),
|
||||||
(
|
(
|
||||||
Value::Int { value, width, .. },
|
Value::Int { value, width, .. },
|
||||||
Dtype::Int {
|
Dtype::Int {
|
||||||
|
|||||||
Reference in New Issue
Block a user