forked from AbleScript/ablescript
Added placeholders for And + Or
and used placeholders for -, * and / in interpret
This commit is contained in:
parent
e95e0744c6
commit
24b6683b21
|
@ -142,15 +142,15 @@ impl ExecEnv {
|
||||||
let rhs = self.eval_expr(rhs)?;
|
let rhs = self.eval_expr(rhs)?;
|
||||||
match kind {
|
match kind {
|
||||||
Add => lhs + rhs,
|
Add => lhs + rhs,
|
||||||
Subtract => todo!(),
|
Subtract => lhs - rhs,
|
||||||
Multiply => todo!(),
|
Multiply => lhs * rhs,
|
||||||
Divide => todo!(),
|
Divide => lhs / rhs,
|
||||||
Greater => Value::Bool(lhs > rhs),
|
Greater => Value::Bool(lhs > rhs),
|
||||||
Less => Value::Bool(lhs < rhs),
|
Less => Value::Bool(lhs < rhs),
|
||||||
Equal => Value::Bool(lhs == rhs),
|
Equal => Value::Bool(lhs == rhs),
|
||||||
NotEqual => Value::Bool(lhs != rhs),
|
NotEqual => Value::Bool(lhs != rhs),
|
||||||
And => todo!(),
|
And => lhs & rhs,
|
||||||
Or => todo!(),
|
Or => lhs | rhs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Not(expr) => Bool(!self.eval_expr(expr)?.into_bool()),
|
Not(expr) => Bool(!self.eval_expr(expr)?.into_bool()),
|
||||||
|
|
|
@ -392,6 +392,22 @@ impl PartialOrd for Value {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl ops::BitAnd for Value {
|
||||||
|
type Output = Value;
|
||||||
|
|
||||||
|
fn bitand(self, rhs: Self) -> Self::Output {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ops::BitOr for Value {
|
||||||
|
type Output = Value;
|
||||||
|
|
||||||
|
fn bitor(self, rhs: Self) -> Self::Output {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Display for Value {
|
impl Display for Value {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in a new issue