diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 15cf60b..49c916a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,6 +6,8 @@ pub mod lib; use rustyline::error::ReadlineError; use rustyline::Editor; +use lib::environment::Environment; + fn read<T: rustyline::Helper>(rl: &mut Editor<T>) -> Option<String> { let readline = rl.readline(">> "); match readline { @@ -35,13 +37,12 @@ fn means_exit(input: &str) -> bool { } } -fn eval(env: &mut lib::eval::Env, input: &str) -> String { +fn eval(env: &mut Environment, input: &str) -> String { let sexp = match lib::parse::parse(input) { Ok(x) => x, Err(f) => return f }; - println!("{:?}", sexp); let res = lib::eval::eval(&sexp, env); match res { Ok(x) => format!("{:?}", x), @@ -50,7 +51,7 @@ fn eval(env: &mut lib::eval::Env, input: &str) -> String { } fn main() { - let mut env = lib::eval::Env::new(); + let mut env = Environment::new(); let hist_file = "history.txt"; // `()` can be used when no completer is required |