Add debugging interface.
This commit is contained in:
@@ -44,8 +44,10 @@ impl Engine {
|
||||
/// Evaluate an [`AST`] with own scope, returning any error (if any).
|
||||
#[inline]
|
||||
pub fn run_ast_with_scope(&self, scope: &mut Scope, ast: &AST) -> RhaiResultOf<()> {
|
||||
let state = &mut EvalState::new();
|
||||
let global = &mut GlobalRuntimeState::new();
|
||||
let mut state = EvalState::new();
|
||||
#[cfg(feature = "debugging")]
|
||||
global.debugger.activate(self.debugger.is_some());
|
||||
global.source = ast.source_raw().clone();
|
||||
|
||||
#[cfg(not(feature = "no_module"))]
|
||||
@@ -64,7 +66,7 @@ impl Engine {
|
||||
} else {
|
||||
&lib
|
||||
};
|
||||
self.eval_global_statements(scope, global, &mut state, statements, lib, 0)?;
|
||||
self.eval_global_statements(scope, global, state, statements, lib, 0)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user