aboutsummaryrefslogtreecommitdiff
path: root/src/interpreter.rs
diff options
context:
space:
mode:
authorCody <cody@codyq.dev>2023-02-27 12:29:02 -0600
committerCody <cody@codyq.dev>2023-02-27 12:29:02 -0600
commit0c5616a91d7280341dc6aa522daf04d151108d4e (patch)
tree66764fc099073092c0359ddf0d18c12a1f824cd9 /src/interpreter.rs
parente4199d2837d2179f17e97b8d50366d96c8babded (diff)
downloadsloth-0c5616a91d7280341dc6aa522daf04d151108d4e.tar.gz
Cleaned up some code
Diffstat (limited to 'src/interpreter.rs')
-rw-r--r--src/interpreter.rs15
1 files changed, 7 insertions, 8 deletions
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<Value> 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<Value> 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<Value> 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)
}
}