|
|
|
@ -7,7 +7,7 @@ pub use eval_res::EvalRes; |
|
|
|
|
use crate::asm::data::literal::Value; |
|
|
|
|
use crate::asm::data::Mask; |
|
|
|
|
use crate::asm::error::CrsnError; |
|
|
|
|
use crate::asm::instr::{Op, Flatten}; |
|
|
|
|
use crate::asm::instr::{Flatten, Op}; |
|
|
|
|
use crate::asm::parse::arg_parser::TokenParser; |
|
|
|
|
use crate::runtime::fault::Fault; |
|
|
|
|
use crate::runtime::run_thread::state::RunState; |
|
|
|
@ -47,14 +47,14 @@ pub trait CrsnExtension: Debug + Send + Sync + 'static { |
|
|
|
|
|
|
|
|
|
/// Parse a generic S-expression (non-op)
|
|
|
|
|
fn parse_syntax(&self, keyword: &str, tokens: TokenParser, parsers: &[Box<dyn CrsnExtension>]) |
|
|
|
|
-> Result<ParseRes<Box<dyn Flatten>>, CrsnError> |
|
|
|
|
-> Result<ParseRes<Box<dyn Flatten>>, CrsnError> |
|
|
|
|
{ |
|
|
|
|
Ok(ParseRes::Unknown(tokens)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// Drop an object referenced by a handle
|
|
|
|
|
fn drop_obj(&self, ti: &ThreadInfo, state: &mut RunState, handle: Value) |
|
|
|
|
-> Result<Option<()>, Fault> |
|
|
|
|
-> Result<Option<()>, Fault> |
|
|
|
|
{ |
|
|
|
|
// Default impl - we do not support dropping this object
|
|
|
|
|
Ok(None) |
|
|
|
@ -62,7 +62,7 @@ pub trait CrsnExtension: Debug + Send + Sync + 'static { |
|
|
|
|
|
|
|
|
|
/// Run-time method called to read an object (using the object handle syntax)
|
|
|
|
|
fn read_obj(&self, ti: &ThreadInfo, state: &mut RunState, handle: Value, _mask: Mask) |
|
|
|
|
-> Result<Option<Value>, Fault> |
|
|
|
|
-> Result<Option<Value>, Fault> |
|
|
|
|
{ |
|
|
|
|
// Default impl - we do not support reading this object
|
|
|
|
|
Ok(None) |
|
|
|
@ -70,7 +70,7 @@ pub trait CrsnExtension: Debug + Send + Sync + 'static { |
|
|
|
|
|
|
|
|
|
/// Run-time method called to write an object (using the object handle syntax)
|
|
|
|
|
fn write_obj(&self, ti: &ThreadInfo, state: &mut RunState, handle: Value, mask: Mask) |
|
|
|
|
-> Result<Option<()>, Fault> |
|
|
|
|
-> Result<Option<()>, Fault> |
|
|
|
|
{ |
|
|
|
|
// Default impl - we do not support writing this object
|
|
|
|
|
Ok(None) |
|
|
|
|