use crate::{ compile::{ctx::Ctx, error::*, ir, visit::*}, syn::{ast::*, op::BinOp, span::*}, }; // basic block pub enum Block { Body(ir::Body), } pub struct TranslateAst<'c, 't> { ctx: &'c mut Ctx, text: &'t str, } impl<'c, 't> TranslateAst<'c, 't> { pub fn new(ctx: &'c mut Ctx, text: &'t str) -> Self { TranslateAst { ctx, text } } pub fn translate(&mut self, _ast: &Vec) -> Result { todo!() } fn visit_lhs_expr(&mut self, expr: &Expr) -> Result { match expr { Expr::Bin(b) if b.op == BinOp::Dot => todo!(), Expr::Base(BaseExpr { kind: BaseExprKind::Ident, .. }) => { let _name = expr.text_at(self.text); //let name_id = self.ctx. todo!() //Ok(ir::Lhs::Name( } _ => todo!(), } } } impl Visit for TranslateAst<'_, '_> { type Out = Result; fn visit(&mut self, _stmt: &Stmt) -> Self::Out { todo!() } } impl Visit for TranslateAst<'_, '_> { type Out = Result; fn visit(&mut self, _stmt: &AssignStmt) -> Self::Out { todo!() } } impl Visit for TranslateAst<'_, '_> { type Out = Result; fn visit(&mut self, _expr: &Expr) -> Self::Out { todo!() } }