Remove giant comment block left in by mistake

This commit is contained in:
Alex Bethel 2021-06-07 16:28:27 -05:00
parent 3bca3f88a6
commit aedeeb2512

View file

@ -171,73 +171,6 @@ impl ExecEnv {
Not(expr) => Bool(!bool::from(self.eval_expr(&expr)?)), Not(expr) => Bool(!bool::from(self.eval_expr(&expr)?)),
Literal(value) => value.clone(), Literal(value) => value.clone(),
Variable(name) => self.get_var(&name)?, Variable(name) => self.get_var(&name)?,
// Binary expressions.
// Add | Subtract | Multiply | Divide | Lt | Gt | Eq | Neq | And | Or => {
// let lhs = self.eval_expr(lhs)?;
// let rhs = self.eval_expr(rhs)?;
// match expr {
// // Arithmetic operators.
// Add { .. } | Subtract { .. } | Multiply { .. } | Divide { .. } => {
// let lhs = i32::try_from(lhs)?;
// let rhs = i32::try_from(rhs)?;
// let res = match expr {
// Add { .. } => lhs.checked_add(rhs),
// Subtract { .. } => lhs.checked_sub(rhs),
// Multiply { .. } => lhs.checked_mul(rhs),
// Divide { .. } => lhs.checked_div(rhs),
// _ => unreachable!(),
// }
// .ok_or(Error {
// kind: ErrorKind::ArithmeticError,
// position: 0..0,
// })?;
// Int(res)
// }
// // Numeric comparisons.
// Lt { .. } | Gt { .. } => {
// let lhs = i32::try_from(lhs)?;
// let rhs = i32::try_from(rhs)?;
// let res = match expr {
// Lt { .. } => lhs < rhs,
// Gt { .. } => lhs > rhs,
// _ => unreachable!(),
// };
// Bool(res)
// }
// // General comparisons.
// Eq { .. } | Neq { .. } => {
// let res = match expr {
// Eq { .. } => lhs == rhs,
// Neq { .. } => lhs != rhs,
// _ => unreachable!(),
// };
// Bool(res)
// }
// // Logical connectives.
// And { .. } | Or { .. } => {
// let lhs = bool::from(lhs);
// let rhs = bool::from(rhs);
// let res = match expr {
// And { .. } => lhs && rhs,
// Or { .. } => lhs || rhs,
// _ => unreachable!(),
// };
// Bool(res)
// }
// // That's all the binary operations.
// _ => unreachable!(),
// }
// }
// Not(expr) => Bool(!bool::from(self.eval_expr(expr)?)),
// Literal(value) => value.clone(),
// Identifier(Iden(name)) => self.get_var(name)?,
}) })
} }