Add debugging interface.
This commit is contained in:
@@ -64,7 +64,7 @@ impl Engine {
|
||||
self.resolve_var = Some(Box::new(callback));
|
||||
self
|
||||
}
|
||||
/// _(internals)_ Provide a callback that will be invoked during parsing to remap certain tokens.
|
||||
/// _(internals)_ Register a callback that will be invoked during parsing to remap certain tokens.
|
||||
/// Exported under the `internals` feature only.
|
||||
///
|
||||
/// # Callback Function Signature
|
||||
@@ -261,4 +261,22 @@ impl Engine {
|
||||
self.debug = Some(Box::new(callback));
|
||||
self
|
||||
}
|
||||
/// _(debugging)_ Register a callback for debugging.
|
||||
/// Exported under the `debugging` feature only.
|
||||
#[cfg(feature = "debugging")]
|
||||
#[inline(always)]
|
||||
pub fn on_debugger(
|
||||
&mut self,
|
||||
callback: impl Fn(
|
||||
&mut EvalContext,
|
||||
crate::ast::ASTNode,
|
||||
Option<&str>,
|
||||
Position,
|
||||
) -> crate::eval::DebuggerCommand
|
||||
+ SendSync
|
||||
+ 'static,
|
||||
) -> &mut Self {
|
||||
self.debugger = Some(Box::new(callback));
|
||||
self
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user