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
use thiserror::Error;
#[derive(Clone, Debug, PartialEq, Eq, Error)]
pub enum ParseRuleError {
    #[error("Missing expected {0:?}")]
    Missing(char),
    #[error("Missing expected number")]
    MissingNumber,
    #[error("Unexpected {0:?}")]
    Unexpected(char),
    #[error("Extra unparsed junk at the end of the rule string")]
    ExtraJunk,
    #[error("Number of states less than 2 in Generations rule")]
    GenLessThan2,
    #[error("Not a MAP rule")]
    NotMapRule,
    #[error("Invalid Base64 encoding for MAP rule")]
    Base64Error,
    #[error("Invalid length for MAP rule")]
    InvalidLength,
    #[error("Generations number overflow for Generations rule")]
    GenOverflow,
}