rhai/src/ast/flags.rs

32 lines
1.0 KiB
Rust
Raw Normal View History

2021-12-17 09:07:13 +01:00
//! Module defining script options.
2022-02-25 04:42:59 +01:00
use bitflags::bitflags;
2022-01-04 15:16:20 +01:00
#[cfg(feature = "no_std")]
use std::prelude::v1::*;
2022-02-26 10:41:27 +01:00
/// 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,
}
2022-02-25 04:42:59 +01:00
bitflags! {
/// _(internals)_ A type that holds a configuration option with bit-flags.
2021-12-17 09:07:13 +01:00
/// Exported under the `internals` feature only.
2022-02-25 04:42:59 +01:00
pub struct ASTFlags: u8 {
/// No options for the [`AST`][crate::AST] node.
const NONE = 0b0000_0000;
/// The [`AST`][crate::AST] node is read-only.
const CONSTANT = 0b0000_0001;
/// The [`AST`][crate::AST] node is exposed to the outside (i.e. public).
const EXPORTED = 0b0000_0010;
/// The [`AST`][crate::AST] node is negated (i.e. whatever information is the opposite).
const NEGATED = 0b0000_0100;
/// The [`AST`][crate::AST] node breaks out of normal control flow.
const BREAK = 0b0000_1000;
2021-12-17 09:07:13 +01:00
}
}