@@ -1,11 +1,6 @@
|
||||
use crate::{
|
||||
compile::{ctx::Ctx, error::*, ir, visit::*},
|
||||
syn::{ast::*, op::BinOp, span::*},
|
||||
compile::{
|
||||
ctx::Ctx,
|
||||
error::*,
|
||||
ir,
|
||||
visit::*,
|
||||
},
|
||||
};
|
||||
|
||||
// basic block
|
||||
@@ -20,10 +15,7 @@ pub struct TranslateAst<'c, 't> {
|
||||
|
||||
impl<'c, 't> TranslateAst<'c, 't> {
|
||||
pub fn new(ctx: &'c mut Ctx, text: &'t str) -> Self {
|
||||
TranslateAst {
|
||||
ctx,
|
||||
text,
|
||||
}
|
||||
TranslateAst { ctx, text }
|
||||
}
|
||||
|
||||
pub fn translate(&mut self, ast: &Vec<Stmt>) -> Result<ir::Body> {
|
||||
@@ -33,13 +25,16 @@ impl<'c, 't> TranslateAst<'c, 't> {
|
||||
fn visit_lhs_expr(&mut self, expr: &Expr) -> Result<ir::Lhs> {
|
||||
match expr {
|
||||
Expr::Bin(b) if b.op == BinOp::Dot => todo!(),
|
||||
Expr::Base(BaseExpr { kind: BaseExprKind::Ident, .. }) => {
|
||||
Expr::Base(BaseExpr {
|
||||
kind: BaseExprKind::Ident,
|
||||
..
|
||||
}) => {
|
||||
let name = expr.text_at(self.text);
|
||||
//let name_id = self.ctx.
|
||||
todo!()
|
||||
todo!()
|
||||
//Ok(ir::Lhs::Name(
|
||||
}
|
||||
_ => todo!()
|
||||
_ => todo!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user