Skip to content

Commit

Permalink
move text grammar to the parser module
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Feb 8, 2023
1 parent 514952c commit 3d4777a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,19 +271,8 @@
//! ## `Debug` and `Display`
//!
//! The `Debug` trait can be derived for a reasonable implementation. This library defines a standard
//! text-based representation for flags that generated flags types can use. It uses the following
//! whitespace and case insensitive grammar:
//!
//! - _Flags:_ (_Flag_)`|`*
//! - _Flag:_ _Identifier_ | _HexNumber_
//! - _Identifier:_ Any Rust identifier
//! - _HexNumber_: `0x`([0-9a-zA-Z])*
//!
//! As an example, this is how `Flags::A | Flags::B | 0x0c` can be represented as text:
//!
//! ```text
//! A | B | 0x0c
//! ```
//! text-based representation for flags that generated flags types can use. For details on the exact
//! grammar, see the [`parser`] module.
//!
//! ## `PartialEq` and `PartialOrd`
//!
Expand Down
14 changes: 14 additions & 0 deletions src/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
//! Parsing flags from text.
//!
//! `bitflags` defines the following whitespace-insensitive grammar for flags formatted
//! as text:
//!
//! - _Flags:_ (_Flag_)`|`*
//! - _Flag:_ _Identifier_ | _HexNumber_
//! - _Identifier:_ Any Rust identifier
//! - _HexNumber_: `0x`([0-9a-zA-Z])*
//!
//! As an example, this is how `Flags::A | Flags::B | 0x0c` can be represented as text:
//!
//! ```text
//! A | B | 0x0c
//! ```
use core::fmt;

Expand Down

0 comments on commit 3d4777a

Please sign in to comment.