From e76773195337b75032e09ad2cab12ed030b3a756 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sat, 26 Feb 2022 17:41:27 +0800 Subject: [PATCH] Fix no_function feature. --- src/ast/flags.rs | 9 +++++++++ src/ast/mod.rs | 4 ++-- src/ast/script_fn.rs | 9 --------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ast/flags.rs b/src/ast/flags.rs index 1e0ad969..264a6374 100644 --- a/src/ast/flags.rs +++ b/src/ast/flags.rs @@ -4,6 +4,15 @@ use bitflags::bitflags; #[cfg(feature = "no_std")] use std::prelude::v1::*; +/// A type representing the access mode of a function. +#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub enum FnAccess { + /// Private function. + Private, + /// Public function. + Public, +} + bitflags! { /// _(internals)_ A type that holds a configuration option with bit-flags. /// Exported under the `internals` feature only. diff --git a/src/ast/mod.rs b/src/ast/mod.rs index 9b24ddb3..16be3bb9 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -9,13 +9,13 @@ pub mod stmt; pub use ast::{ASTNode, AST}; pub use expr::{BinaryExpr, CustomExpr, Expr, FnCallExpr, FnCallHashes}; -pub use flags::ASTFlags; +pub use flags::{ASTFlags, FnAccess}; pub use ident::Ident; #[cfg(not(feature = "no_module"))] #[cfg(not(feature = "no_function"))] pub use script_fn::EncapsulatedEnviron; #[cfg(not(feature = "no_function"))] -pub use script_fn::{FnAccess, ScriptFnDef, ScriptFnMetadata}; +pub use script_fn::{ScriptFnDef, ScriptFnMetadata}; pub use stmt::{ ConditionalStmtBlock, OpAssignment, Stmt, StmtBlock, StmtBlockContainer, SwitchCases, TryCatchBlock, diff --git a/src/ast/script_fn.rs b/src/ast/script_fn.rs index 29f8e0c8..48114ee9 100644 --- a/src/ast/script_fn.rs +++ b/src/ast/script_fn.rs @@ -7,15 +7,6 @@ use crate::{Identifier, StaticVec}; use std::prelude::v1::*; use std::{fmt, hash::Hash}; -/// A type representing the access mode of a function. -#[derive(Debug, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub enum FnAccess { - /// Private function. - Private, - /// Public function. - Public, -} - /// _(internals)_ Encapsulated AST environment. /// Exported under the `internals` feature only. ///