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
29
30
31
32
33
34
35
36
37
use strum_macros::{EnumString, IntoStaticStr};
use thiserror::Error;
use crate::{helper::macros::verbose_error_to_error, osu_file::events};
#[derive(Debug, Error, EnumString, IntoStaticStr)]
#[non_exhaustive]
pub enum ParseError {
#[error("Unexpected line before any section")]
UnexpectedLine,
#[error("There are multiple sections defined as the same name")]
DuplicateSections,
#[error("There is an unknown section")]
UnknownSection,
#[error(transparent)]
#[strum(disabled)]
ParseVariableError(#[from] ParseVariableError),
#[error(transparent)]
#[strum(disabled)]
ParseEventsError(#[from] events::ParseError),
}
verbose_error_to_error!(ParseError);
#[derive(Debug, Error, EnumString, IntoStaticStr)]
#[non_exhaustive]
pub enum ParseVariableError {
#[error("Missing the header `$`")]
MissingHeader,
#[error("Missing `=` for assignment")]
MissingEquals,
}
verbose_error_to_error!(ParseVariableError);