Run cargo fmt

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
2020-05-20 15:25:10 -04:00
parent 161166da15
commit 0eaa5060a2
19 changed files with 69 additions and 120 deletions

View File

@@ -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!(),
}
}
}