wildcard-glob 11.2.0

Zero-dependency, zero-allocation compiled wildcard and path glob pattern matcher supporting *, **, ?, character classes, brace alternation, and multi-pattern GlobSet.
Documentation
use super::*;

/// Compiled character class with O(1) 128-bit ASCII bitset and fallback non-ASCII ranges.
#[derive(Clone, Debug, Eq, PartialEq)]
pub(crate) struct CharClass {
    /// Pre-negated bitset for ASCII codes `0..=63`.
    pub(crate) ascii_lo: u64,
    /// Pre-negated bitset for ASCII codes `64..=127`.
    pub(crate) ascii_hi: u64,
    /// Whether non-ASCII match results are inverted (`[!...]`).
    pub(crate) negated: bool,
    /// Inclusive non-ASCII character ranges `(start, end)`.
    pub(crate) non_ascii: Vec<(char, char)>,
}

/// A compiled wildcard/path glob matcher supporting `*`, `**`, `?`, `[...]`, and `{a,b}`.
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct GlobPattern {
    /// Original source pattern string.
    pub(crate) source: String,
    /// Whether `*` and `?` do not cross `/` path separators.
    pub(crate) path_aware: bool,
    /// Expanded compiled branches (one for patterns without braces).
    pub(crate) branches: Vec<CompiledBranch>,
}