add serialization of values
This commit is contained in:
parent
da82c775db
commit
6350e4a40f
5 changed files with 87 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
|||
use std::io::stdin;
|
||||
use std::io::{stdin, stdout, Write};
|
||||
|
||||
use microlang::Context;
|
||||
|
||||
|
@ -6,9 +6,14 @@ pub fn main() {
|
|||
unsafe { backtrace_on_stack_overflow::enable() };
|
||||
let mut context = Context::empty();
|
||||
loop {
|
||||
print!("> ");
|
||||
stdout().flush().ok();
|
||||
let mut line = String::new();
|
||||
stdin().read_line(&mut line).unwrap();
|
||||
let res = context.eval(line);
|
||||
dbg!(res).ok();
|
||||
match res {
|
||||
Ok((_, value)) => println!("{}", value.serialize()),
|
||||
Err(e) => println!("Error : {e:?}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue