@@ -18,7 +18,7 @@ impl<'c, 't> TranslateAst<'c, 't> {
|
|||||||
TranslateAst { ctx, text }
|
TranslateAst { ctx, text }
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn translate(&mut self, ast: &Vec<Stmt>) -> Result<ir::Body> {
|
pub fn translate(&mut self, _ast: &Vec<Stmt>) -> Result<ir::Body> {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ impl<'c, 't> TranslateAst<'c, 't> {
|
|||||||
kind: BaseExprKind::Ident,
|
kind: BaseExprKind::Ident,
|
||||||
..
|
..
|
||||||
}) => {
|
}) => {
|
||||||
let name = expr.text_at(self.text);
|
let _name = expr.text_at(self.text);
|
||||||
//let name_id = self.ctx.
|
//let name_id = self.ctx.
|
||||||
todo!()
|
todo!()
|
||||||
//Ok(ir::Lhs::Name(
|
//Ok(ir::Lhs::Name(
|
||||||
@@ -42,7 +42,7 @@ impl<'c, 't> TranslateAst<'c, 't> {
|
|||||||
impl Visit<Stmt> for TranslateAst<'_, '_> {
|
impl Visit<Stmt> for TranslateAst<'_, '_> {
|
||||||
type Out = Result<ir::Stmt>;
|
type Out = Result<ir::Stmt>;
|
||||||
|
|
||||||
fn visit(&mut self, stmt: &Stmt) -> Self::Out {
|
fn visit(&mut self, _stmt: &Stmt) -> Self::Out {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -50,7 +50,7 @@ impl Visit<Stmt> for TranslateAst<'_, '_> {
|
|||||||
impl Visit<AssignStmt> for TranslateAst<'_, '_> {
|
impl Visit<AssignStmt> for TranslateAst<'_, '_> {
|
||||||
type Out = Result<ir::Stmt>;
|
type Out = Result<ir::Stmt>;
|
||||||
|
|
||||||
fn visit(&mut self, stmt: &AssignStmt) -> Self::Out {
|
fn visit(&mut self, _stmt: &AssignStmt) -> Self::Out {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -58,7 +58,7 @@ impl Visit<AssignStmt> for TranslateAst<'_, '_> {
|
|||||||
impl Visit<Expr> for TranslateAst<'_, '_> {
|
impl Visit<Expr> for TranslateAst<'_, '_> {
|
||||||
type Out = Result<ir::Expr>;
|
type Out = Result<ir::Expr>;
|
||||||
|
|
||||||
fn visit(&mut self, expr: &Expr) -> Self::Out {
|
fn visit(&mut self, _expr: &Expr) -> Self::Out {
|
||||||
todo!()
|
todo!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ fn main() -> Result<()> {
|
|||||||
let mut collect_names = compile::name::CollectNames::new(&mut ctx, text.as_str());
|
let mut collect_names = compile::name::CollectNames::new(&mut ctx, text.as_str());
|
||||||
collect_names.collect(&ast);
|
collect_names.collect(&ast);
|
||||||
}
|
}
|
||||||
let names = ctx.name_stack_mut().pop().unwrap();
|
let _names = ctx.name_stack_mut().pop().unwrap();
|
||||||
//println!("{:#?}", names);
|
//println!("{:#?}", names);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -118,22 +118,21 @@ impl<'i, I: Intern> AttrsBuilder<'i, I> {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_attrs_new() {
|
fn test_attrs_new() {
|
||||||
use crate::mem::{BasicGc, BasicIntern};
|
use crate::mem::BasicGc;
|
||||||
|
|
||||||
let mut gc = BasicGc::default();
|
let mut gc = BasicGc::default();
|
||||||
let mut intern = BasicIntern::default();
|
|
||||||
|
|
||||||
let attrs_ref = Attrs::new(&mut gc, Default::default());
|
let attrs_ref = Attrs::new(&mut gc, Default::default());
|
||||||
|
|
||||||
{
|
{
|
||||||
let mut attrs = attrs_ref.borrow_mut();
|
let mut attrs = attrs_ref.borrow_mut();
|
||||||
let sym = intern.intern_sym("symbol");
|
let sym = Sym::new(0);
|
||||||
attrs.insert(sym, attrs_ref.as_dyn());
|
attrs.insert(sym, attrs_ref.as_dyn());
|
||||||
|
|
||||||
assert!(ptr::eq(
|
assert!(ptr::eq(
|
||||||
dbg!(attrs.get(sym).unwrap().as_ptr()),
|
dbg!(attrs.get(sym).unwrap().as_ptr()),
|
||||||
dbg!(attrs_ref.as_dyn().as_ptr()) // ^ as_dyn() is important here - this will cause the test to fail
|
dbg!(attrs_ref.as_dyn().as_ptr())
|
||||||
// otherwise
|
// as_dyn() is important here - this will cause the test to fail otherwise
|
||||||
),);
|
),);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pub struct NativeFun {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl NativeFun {
|
impl NativeFun {
|
||||||
pub fn new(attrs: AttrsRef, name: StrRef, fn_ptr: NativeFunPtr) -> Self {
|
pub fn new(attrs: AttrsRef, _name: StrRef, fn_ptr: NativeFunPtr) -> Self {
|
||||||
// TODO : clone attrs, add name
|
// TODO : clone attrs, add name
|
||||||
NativeFun { attrs, fn_ptr }
|
NativeFun { attrs, fn_ptr }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user