From 0c5616a91d7280341dc6aa522daf04d151108d4e Mon Sep 17 00:00:00 2001 From: Cody Date: Mon, 27 Feb 2023 12:29:02 -0600 Subject: Cleaned up some code --- src/interpreter.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/interpreter.rs') diff --git a/src/interpreter.rs b/src/interpreter.rs index adf6755..a7937db 100644 --- a/src/interpreter.rs +++ b/src/interpreter.rs @@ -1,5 +1,5 @@ use std::collections::HashMap; -use std::fmt::{Debug, Display}; +use std::fmt::Display; use itertools::Itertools; @@ -42,10 +42,10 @@ impl AstVisitor for AstInterpreter { self.memory.insert(ident.clone(), (value, true)); } Stmt::Function { - ident: name, - arguments, - return_type, - body, + ident: _, + arguments: _, + return_type: _, + body: _, } => todo!(), Stmt::If { condition, body } => { let result = self.visit_expr(condition); @@ -74,7 +74,7 @@ impl AstVisitor for AstInterpreter { self.interpret(body); } } - Stmt::Return { value } => todo!(), + Stmt::Return { value: _ } => todo!(), }; // FIXME: Honestly should probably abandon this "visitor" pattern. 2 functions @@ -168,7 +168,6 @@ impl AstVisitor for AstInterpreter { self.callables.insert(ident.clone(), callable); result } - _ => unimplemented!("{:?}", expr), } } } @@ -196,7 +195,7 @@ pub trait SlothCallable { pub struct InternalFunction<'a>(pub &'a dyn Fn(&[Value]) -> Value); impl<'a> SlothCallable for InternalFunction<'a> { - fn call(&self, interpreter: &mut AstInterpreter, args: &[Value]) -> Value { + fn call(&self, _interpreter: &mut AstInterpreter, args: &[Value]) -> Value { self.0(args) } } -- cgit v1.2.3