Add plumbing for displaying RocDec in the repl.

This commit is contained in:
Derek Gustafson 2022-03-04 17:32:09 -05:00
parent 874ce855bc
commit dc92de7781
No known key found for this signature in database
GPG key ID: 8B8B15EF3CC8410B
6 changed files with 61 additions and 18 deletions

View file

@ -1,4 +1,5 @@
use roc_parse::ast::Expr;
use roc_std::RocDec;
pub mod eval;
pub mod gen;
@ -47,5 +48,10 @@ pub trait ReplAppMemory {
fn deref_f32(&self, addr: usize) -> f32;
fn deref_f64(&self, addr: usize) -> f64;
fn deref_dec(&self, addr: usize) -> RocDec {
let bits = self.deref_i128(addr);
return RocDec(bits);
}
fn deref_str(&self, addr: usize) -> &str;
}