Skip to content

Commit

Permalink
Merge pull request #736 from ltabis/main
Browse files Browse the repository at this point in the history
Update bitflags
  • Loading branch information
schungx committed Jul 27, 2023
2 parents 26fd283 + 1e9674f commit ffd48c4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ smallvec = { version = "1.7", default-features = false, features = ["union", "co
ahash = { version = "0.8.2", default-features = false, features = ["compile-time-rng"] }
num-traits = { version = "0.2", default-features = false }
once_cell = { version = "1", default-features = false, features = ["race"] }
bitflags = { version = "1", default-features = false }
bitflags = { version = "2", default-features = false }
smartstring = { version = "1", default-features = false }
rhai_codegen = { version = "1.5.0", path = "codegen", default-features = false }

Expand Down
1 change: 1 addition & 0 deletions src/api/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::prelude::v1::*;

bitflags! {
/// Bit-flags containing all language options for the [`Engine`].
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub struct LangOptions: u16 {
/// Is `if`-expression allowed?
const IF_EXPR = 0b_0000_0000_0001;
Expand Down
7 changes: 7 additions & 0 deletions src/ast/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ impl FnAccess {
bitflags! {
/// _(internals)_ Bit-flags containing [`AST`][crate::AST] node configuration options.
/// Exported under the `internals` feature only.
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy)]
pub struct ASTFlags: u8 {
/// The [`AST`][crate::AST] node is read-only.
const CONSTANT = 0b_0000_0001;
Expand All @@ -51,3 +52,9 @@ bitflags! {
const BREAK = 0b_0000_1000;
}
}

impl std::fmt::Debug for ASTFlags {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", &self.0)
}
}
1 change: 1 addition & 0 deletions src/module/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ pub fn calc_native_fn_hash<'a>(

bitflags! {
/// Bit-flags containing all status for [`Module`].
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub struct ModuleFlags: u8 {
/// Is the [`Module`] internal?
const INTERNAL = 0b0000_0001;
Expand Down
1 change: 1 addition & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ impl<'e, 's> ParseState<'e, 's> {

bitflags! {
/// Bit-flags containing all status for [`ParseSettings`].
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)]
pub struct ParseSettingFlags: u8 {
/// Is the construct being parsed located at global level?
const GLOBAL_LEVEL = 0b0000_0001;
Expand Down

0 comments on commit ffd48c4

Please sign in to comment.