forked from MightyPork/crsn
add pretty-printer for assembled instructions
This commit is contained in:
+11
-1
@@ -7,6 +7,9 @@ use crsn::runtime::fault::Fault;
|
||||
use crsn::runtime::run_thread::{state::RunState, ThreadInfo};
|
||||
|
||||
use crate::defs::StackOp;
|
||||
use crsn::sexp::Sexp;
|
||||
use crsn::sexp;
|
||||
use crsn::utils::A;
|
||||
|
||||
#[derive(Debug, Default)]
|
||||
struct Stacks {
|
||||
@@ -64,7 +67,14 @@ impl OpTrait for StackOp {
|
||||
|
||||
Ok(eres)
|
||||
}
|
||||
//
|
||||
|
||||
fn to_sexp(&self) -> Sexp {
|
||||
match self {
|
||||
StackOp::NewStack { dst } => sexp::list(&[A("stack"), A(dst)]),
|
||||
StackOp::Push { obj, src } => sexp::list(&[A("push"), A(obj), A(src)]),
|
||||
StackOp::Pop { dst, obj } => sexp::list(&[A("pop"), A(dst), A(obj)]),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn drop_obj(state: &mut RunState, handle: Value) -> Result<Option<()>, Fault> {
|
||||
|
||||
Reference in New Issue
Block a user