Implement where and

This commit is contained in:
Bennett Clement
2024-07-15 23:19:46 +08:00
parent a485aefb52
commit d1288cacef

View File

@@ -569,6 +569,25 @@ fn translate_condition_expr(
select: &Select,
expr: &ast::Expr,
jump_target: BranchOffset,
) -> Result<()> {
match expr {
ast::Expr::Binary(e1, op, e2) => match op {
ast::Operator::And => {
let _ = translate_condition_expr(program, select, e1, jump_target)?;
let _ = translate_condition_expr(program, select, e2, jump_target)?;
Ok(())
}
_ => translate_condition_expr_leaf(program, select, expr, jump_target),
},
_ => translate_condition_expr_leaf(program, select, expr, jump_target),
}
}
fn translate_condition_expr_leaf(
program: &mut ProgramBuilder,
select: &Select,
expr: &ast::Expr,
jump_target: BranchOffset,
) -> Result<()> {
match expr {
ast::Expr::Between { .. } => todo!(),