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