forked from AbleScript/ablescript
Removed And and Or ops because they aren't cursed enough
This commit is contained in:
parent
49ba66de07
commit
92f2c62d59
|
@ -164,8 +164,6 @@ pub enum BinOpKind {
|
|||
Less,
|
||||
Equal,
|
||||
NotEqual,
|
||||
And,
|
||||
Or,
|
||||
}
|
||||
|
||||
impl BinOpKind {
|
||||
|
@ -181,8 +179,6 @@ impl BinOpKind {
|
|||
Token::LessThan => Ok(Self::Less),
|
||||
Token::EqualEqual => Ok(Self::Equal),
|
||||
Token::NotEqual => Ok(Self::NotEqual),
|
||||
Token::And => Ok(Self::And),
|
||||
Token::Or => Ok(Self::Or),
|
||||
t => Err(crate::error::ErrorKind::UnexpectedToken(t)),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -149,8 +149,6 @@ impl ExecEnv {
|
|||
Less => Value::Bool(lhs < rhs),
|
||||
Equal => Value::Bool(lhs == rhs),
|
||||
NotEqual => Value::Bool(lhs != rhs),
|
||||
And => lhs & rhs,
|
||||
Or => lhs | rhs,
|
||||
}
|
||||
}
|
||||
Not(expr) => Bool(!self.eval_expr(expr)?.into_bool()),
|
||||
|
|
|
@ -64,12 +64,6 @@ pub enum Token {
|
|||
#[token("!=")]
|
||||
NotEqual,
|
||||
|
||||
#[token("&")]
|
||||
And,
|
||||
|
||||
#[token("|")]
|
||||
Or,
|
||||
|
||||
#[token("!|aint")] // also add aint as a not keyword
|
||||
Not,
|
||||
|
||||
|
|
|
@ -209,9 +209,7 @@ impl<'source> Parser<'source> {
|
|||
| Token::EqualEqual
|
||||
| Token::NotEqual
|
||||
| Token::LessThan
|
||||
| Token::GreaterThan
|
||||
| Token::And
|
||||
| Token::Or => Ok(Expr::new(
|
||||
| Token::GreaterThan => Ok(Expr::new(
|
||||
self.binop_flow(
|
||||
BinOpKind::from_token(token).map_err(|e| Error::new(e, self.lexer.span()))?,
|
||||
buf,
|
||||
|
|
|
@ -459,22 +459,6 @@ 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 {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
|
Loading…
Reference in a new issue