Fix build.
This commit is contained in:
parent
2889ca0988
commit
98e0042214
@ -4,7 +4,7 @@ use crate::eval::{Caches, GlobalRuntimeState};
|
|||||||
use crate::parser::ParseState;
|
use crate::parser::ParseState;
|
||||||
use crate::types::dynamic::Variant;
|
use crate::types::dynamic::Variant;
|
||||||
use crate::{
|
use crate::{
|
||||||
Dynamic, Engine, Module, OptimizationLevel, Position, RhaiResult, RhaiResultOf, Scope, AST, ERR,
|
Dynamic, Engine, OptimizationLevel, Position, RhaiResult, RhaiResultOf, Scope, AST, ERR,
|
||||||
};
|
};
|
||||||
#[cfg(feature = "no_std")]
|
#[cfg(feature = "no_std")]
|
||||||
use std::prelude::v1::*;
|
use std::prelude::v1::*;
|
||||||
@ -194,7 +194,10 @@ impl Engine {
|
|||||||
#[cfg(feature = "debugging")]
|
#[cfg(feature = "debugging")]
|
||||||
if self.debugger.is_some() {
|
if self.debugger.is_some() {
|
||||||
global.debugger.status = crate::eval::DebuggerStatus::Terminate;
|
global.debugger.status = crate::eval::DebuggerStatus::Terminate;
|
||||||
let lib = &[ast.as_ref()];
|
let lib = &[
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
|
ast.as_ref(),
|
||||||
|
];
|
||||||
let node = &crate::ast::Stmt::Noop(Position::NONE);
|
let node = &crate::ast::Stmt::Noop(Position::NONE);
|
||||||
self.run_debugger(scope, global, lib, &mut None, node, 0)?;
|
self.run_debugger(scope, global, lib, &mut None, node, 0)?;
|
||||||
}
|
}
|
||||||
@ -230,18 +233,17 @@ impl Engine {
|
|||||||
return Ok(Dynamic::UNIT);
|
return Ok(Dynamic::UNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
let lib = [
|
let mut _lib = &[
|
||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
ast.as_ref(),
|
ast.as_ref(),
|
||||||
];
|
][..];
|
||||||
let lib = if lib.first().map(|m: &&Module| m.is_empty()).unwrap_or(true) {
|
#[cfg(not(feature = "no_function"))]
|
||||||
&[]
|
if !ast.has_functions() {
|
||||||
} else {
|
_lib = &[];
|
||||||
&lib[..]
|
}
|
||||||
};
|
|
||||||
|
|
||||||
let result =
|
let result =
|
||||||
self.eval_global_statements(scope, global, &mut caches, statements, lib, level);
|
self.eval_global_statements(scope, global, &mut caches, statements, _lib, level);
|
||||||
|
|
||||||
#[cfg(not(feature = "no_module"))]
|
#[cfg(not(feature = "no_module"))]
|
||||||
{
|
{
|
||||||
@ -266,7 +268,7 @@ impl Engine {
|
|||||||
global: &mut GlobalRuntimeState,
|
global: &mut GlobalRuntimeState,
|
||||||
caches: &mut Caches,
|
caches: &mut Caches,
|
||||||
statements: &[crate::ast::Stmt],
|
statements: &[crate::ast::Stmt],
|
||||||
lib: &[&Module],
|
lib: &[&crate::Module],
|
||||||
level: usize,
|
level: usize,
|
||||||
) -> RhaiResult {
|
) -> RhaiResult {
|
||||||
self.eval_global_statements(scope, global, caches, statements, lib, level)
|
self.eval_global_statements(scope, global, caches, statements, lib, level)
|
||||||
|
@ -68,7 +68,10 @@ impl Engine {
|
|||||||
#[cfg(feature = "debugging")]
|
#[cfg(feature = "debugging")]
|
||||||
if self.debugger.is_some() {
|
if self.debugger.is_some() {
|
||||||
global.debugger.status = crate::eval::DebuggerStatus::Terminate;
|
global.debugger.status = crate::eval::DebuggerStatus::Terminate;
|
||||||
let lib = &[ast.as_ref()];
|
let lib = &[
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
|
ast.as_ref(),
|
||||||
|
];
|
||||||
let node = &crate::ast::Stmt::Noop(crate::Position::NONE);
|
let node = &crate::ast::Stmt::Noop(crate::Position::NONE);
|
||||||
self.run_debugger(scope, global, lib, &mut None, node, 0)?;
|
self.run_debugger(scope, global, lib, &mut None, node, 0)?;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user