From 9bf1a6b6333bbcb1e4531a752a6c82fb93b4903c Mon Sep 17 00:00:00 2001 From: Erin Date: Sat, 6 Aug 2022 21:58:15 +0200 Subject: [PATCH] We do a little... whatever... value printing. --- src/repl.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/repl.rs b/src/repl.rs index 3c7423f..d28614e 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -1,4 +1,4 @@ -use crate::{error::Error, syntax::parser::parse}; +use crate::{error::Error, interpreter::value::Value, syntax::parser::parse}; use rustyline::{error::ReadlineError, Editor}; pub fn repl() -> rustyline::Result<()> { @@ -7,7 +7,9 @@ pub fn repl() -> rustyline::Result<()> { loop { match rl.readline(prompt) { Ok(line) => match parse(&line) { - Ok(values) => values.iter().for_each(|e| println!("{e}")), + Ok(values) => values + .into_iter() + .for_each(|e| println!("{}", Into::::into(e))), Err(e) => e.into_iter().map(Error::Parse).for_each(|e| { if let Err(e) = e.report(&line) { eprintln!("Failed to generate error report\n{e:?}")