MCPcopy Create free account
hub / github.com/aspizu/goboscript / less_than_equal

Function less_than_equal

src/visitor/transformations.rs:211–225  ·  view source on GitHub ↗
(expr: &Expr)

Source from the content-addressed store, hash-verified

209}
210
211pub fn less_than_equal(expr: &Expr) -> Option<Expr> {
212 let Expr::BinOp {
213 op: BinOp::Le,
214 span,
215 lhs,
216 rhs,
217 } = expr
218 else {
219 return None;
220 };
221 Some(UnOp::Not.to_expr(
222 span.clone(),
223 BinOp::Gt.to_expr(span.clone(), lhs.as_ref().clone(), rhs.as_ref().clone()),
224 ))
225}
226
227pub fn greater_than_equal(expr: &Expr) -> Option<Expr> {
228 let Expr::BinOp {

Callers

nothing calls this directly

Calls 1

to_exprMethod · 0.80

Tested by

no test coverage detected