Fix no_function build.
This commit is contained in:
parent
cd4335a16f
commit
4ee6657b9d
@ -283,6 +283,7 @@ fn main() {
|
|||||||
println!("{}", f)
|
println!("{}", f)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(not(feature = "no_function"))]
|
||||||
for f in main_ast.iter_functions() {
|
for f in main_ast.iter_functions() {
|
||||||
println!("{}", f)
|
println!("{}", f)
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,9 @@ impl Engine {
|
|||||||
#[cfg(not(feature = "no_function"))]
|
#[cfg(not(feature = "no_function"))]
|
||||||
if namespace.len() == 1 && namespace[0].name == crate::engine::KEYWORD_GLOBAL {
|
if namespace.len() == 1 && namespace[0].name == crate::engine::KEYWORD_GLOBAL {
|
||||||
if let Some(ref constants) = global.constants {
|
if let Some(ref constants) = global.constants {
|
||||||
if let Some(value) = crate::func::locked_write(constants).get_mut(var_name) {
|
if let Some(value) =
|
||||||
|
crate::func::locked_write(constants).get_mut(var_name)
|
||||||
|
{
|
||||||
let mut target: Target = value.clone().into();
|
let mut target: Target = value.clone().into();
|
||||||
// Module variables are constant
|
// Module variables are constant
|
||||||
target.set_access_mode(AccessMode::ReadOnly);
|
target.set_access_mode(AccessMode::ReadOnly);
|
||||||
|
@ -22,9 +22,6 @@ use std::{
|
|||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct GlobalRuntimeState<'a> {
|
pub struct GlobalRuntimeState<'a> {
|
||||||
/// Stack of module names.
|
/// Stack of module names.
|
||||||
//
|
|
||||||
// We cannot use Cow<str> here because `eval` may load a [module][Module] and
|
|
||||||
// the module name will live beyond the AST of the eval script text.
|
|
||||||
keys: StaticVec<Identifier>,
|
keys: StaticVec<Identifier>,
|
||||||
/// Stack of imported [modules][Module].
|
/// Stack of imported [modules][Module].
|
||||||
modules: StaticVec<Shared<Module>>,
|
modules: StaticVec<Shared<Module>>,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user