neo_solidity/ir/expressions/dispatch/
comparisons.rs

1fn try_lower_expression_comparisons(
2    expr: &Expression,
3    ctx: &mut LoweringContext,
4    instructions: &mut Vec<Instruction>,
5) -> Option<bool> {
6    match expr {
7        Expression::Less(_, left, right) => Some(lower_binary_expr(
8            left,
9            right,
10            ctx,
11            instructions,
12            BinaryOperator::Lt,
13        )),
14        Expression::LessEqual(_, left, right) => Some(lower_binary_expr(
15            left,
16            right,
17            ctx,
18            instructions,
19            BinaryOperator::Le,
20        )),
21        Expression::More(_, left, right) => Some(lower_binary_expr(
22            left,
23            right,
24            ctx,
25            instructions,
26            BinaryOperator::Gt,
27        )),
28        Expression::MoreEqual(_, left, right) => Some(lower_binary_expr(
29            left,
30            right,
31            ctx,
32            instructions,
33            BinaryOperator::Ge,
34        )),
35        Expression::Equal(_, left, right) => Some(lower_binary_expr(
36            left,
37            right,
38            ctx,
39            instructions,
40            BinaryOperator::Eq,
41        )),
42        Expression::NotEqual(_, left, right) => Some(lower_binary_expr(
43            left,
44            right,
45            ctx,
46            instructions,
47            BinaryOperator::Ne,
48        )),
49        _ => None,
50    }
51}