Move level into GlobalRuntimeState.

This commit is contained in:
Stephen Chung
2022-11-08 21:28:20 +08:00
parent 5bae4d8a19
commit e93923b3b6
21 changed files with 409 additions and 493 deletions

View File

@@ -189,7 +189,7 @@ impl Engine {
let global = &mut GlobalRuntimeState::new(self);
let caches = &mut Caches::new();
let result = self.eval_ast_with_scope_raw(global, caches, 0, scope, ast)?;
let result = self.eval_ast_with_scope_raw(global, caches, scope, ast)?;
#[cfg(feature = "debugging")]
if self.debugger.is_some() {
@@ -201,7 +201,7 @@ impl Engine {
let mut this = Dynamic::NULL;
let node = &crate::ast::Stmt::Noop(Position::NONE);
self.run_debugger(global, caches, lib, 0, scope, &mut this, node)?;
self.run_debugger(global, caches, lib, scope, &mut this, node)?;
}
let typ = self.map_type_name(result.type_name());
@@ -217,7 +217,7 @@ impl Engine {
&self,
global: &mut GlobalRuntimeState,
caches: &mut Caches,
level: usize,
scope: &mut Scope,
ast: &'a AST,
) -> RhaiResult {
@@ -244,7 +244,7 @@ impl Engine {
AsRef::<crate::SharedModule>::as_ref(ast).clone(),
];
self.eval_global_statements(global, caches, lib, level, scope, statements)
self.eval_global_statements(global, caches, lib, scope, statements)
}
/// _(internals)_ Evaluate a list of statements with no `this` pointer.
/// Exported under the `internals` feature only.
@@ -261,11 +261,11 @@ impl Engine {
global: &mut GlobalRuntimeState,
caches: &mut Caches,
lib: &[crate::SharedModule],
level: usize,
scope: &mut Scope,
statements: &[crate::ast::Stmt],
) -> RhaiResult {
self.eval_global_statements(global, caches, lib, level, scope, statements)
self.eval_global_statements(global, caches, lib, scope, statements)
}
}