1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Errors that can be returned when parsing rule strings.

// use std::fmt::{self, Display, Formatter};
use displaydoc::Display;
use thiserror::Error;

/// Errors that can be returned when parsing rule strings.
#[derive(Clone, Debug, PartialEq, Eq, Error, Display)]
pub enum ParseRuleError {
    /// Missing expected {0:?}
    Missing(char),
    /// Missing expected number
    MissingNumber,
    /// Unexpected {0:?}
    Unexpected(char),
    /// Extra unparsed junk at the end of the rule string
    ExtraJunk,
    /// Number of states less than 2 in Generations rule
    GenLessThan2,
    /// Not a MAP rule
    NotMapRule,
    /// Invalid Base64 encoding for MAP rule
    Base64Error,
    /// Invalid length for MAP rule
    InvalidLength,
    /// Generations number overflow for Generations rule
    GenOverflow,
}