code cleanup.

This commit is contained in:
Stephen Chung
2022-12-01 14:24:08 +08:00
parent acadb58f4f
commit 28640a6fe4
7 changed files with 9 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ use crate::{Dynamic, Engine, Scope};
use std::prelude::v1::*;
/// Context of a script evaluation process.
#[derive(Debug)]
#[allow(dead_code)]
pub struct EvalContext<'a, 's, 'ps, 'g, 'c, 't> {
/// The current [`Engine`].
engine: &'a Engine,

View File

@@ -3,7 +3,7 @@
use super::{Caches, EvalContext, GlobalRuntimeState, Target};
use crate::api::events::VarDefInfo;
use crate::ast::{
ASTFlags, BinaryExpr, Expr, Ident, OpAssignment, Stmt, SwitchCasesCollection, TryCatchBlock,
ASTFlags, BinaryExpr, Expr, OpAssignment, Stmt, SwitchCasesCollection, TryCatchBlock,
};
use crate::func::{get_builtin_op_assignment_fn, get_hasher};
use crate::types::dynamic::{AccessMode, Union};
@@ -834,6 +834,7 @@ impl Engine {
// Export statement
#[cfg(not(feature = "no_module"))]
Stmt::Export(x, ..) => {
use crate::ast::Ident;
let (Ident { name, pos, .. }, Ident { name: alias, .. }) = &**x;
// Mark scope variables as public
scope.search(name).map_or_else(