Skip to content

Commit

Permalink
ast: remove Is, IsNot, In, NotIn
Browse files Browse the repository at this point in the history
  • Loading branch information
sbillig authored and cburgdorf committed May 10, 2021
1 parent 4b96a0f commit 28d9164
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion compiler/src/yul/mappers/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,6 @@ pub fn expr_comp_operation(context: &Context, exp: &Node<fe::Expr>) -> yul::Expr
true => expression! { iszero((slt([yul_left], [yul_right]))) },
false => expression! { iszero((lt([yul_left], [yul_right]))) },
},
_ => unimplemented!(),
};
}

Expand Down
4 changes: 0 additions & 4 deletions parser/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,4 @@ pub enum CompOperator {
LtE,
Gt,
GtE,
Is,
IsNot,
In,
NotIn,
}
7 changes: 1 addition & 6 deletions parser/src/grammar/expressions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,6 @@ fn infix_binding_power(op: TokenKind) -> Option<(u8, u8)> {
// prefix Not => 65

// all comparisons are the same
// In | NotIn => todo!("in, not in"), // conflicts with current `for` parsing impl
// TODO: `is not`
Is => (70, 71),
Lt | LtEq | Gt | GtEq | NotEq | EqEq => (70, 71),

Pipe => (80, 81),
Expand Down Expand Up @@ -356,8 +353,7 @@ fn infix_op(left: Node<Expr>, op: &Token, right: Node<Expr>) -> Node<Expr> {
bin_op(left, op, right)
}

In => todo!("in, not in"),
Is | Lt | LtEq | Gt | GtEq | NotEq | EqEq => comp_op(left, op, right),
Lt | LtEq | Gt | GtEq | NotEq | EqEq => comp_op(left, op, right),

Dot => {
let span = left.span + right.span;
Expand Down Expand Up @@ -458,7 +454,6 @@ fn comp_op(left: Node<Expr>, op: &Token, right: Node<Expr>) -> Node<Expr> {
use TokenKind::*;
let astop = match op.kind {
In => todo!("in"), // CompOperator::In,
Is => CompOperator::Is,
Lt => CompOperator::Lt,
LtEq => CompOperator::LtE,
Gt => CompOperator::Gt,
Expand Down
3 changes: 0 additions & 3 deletions parser/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,6 @@ pub enum TokenKind {
As,
#[token("in")]
In,
#[token("is")]
Is,
#[token("not")]
Not,
#[token("or")]
Expand Down Expand Up @@ -246,7 +244,6 @@ impl TokenKind {
And => "and",
As => "as",
In => "in",
Is => "is",
Not => "not",
Or => "or",
ParenOpen => "(",
Expand Down

0 comments on commit 28d9164

Please sign in to comment.