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
38
39
40
41
42
43
44
45
46
47
48
use std::path::PathBuf;
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ParsePresetError {
#[error("shader preset lexing error")]
LexerError { offset: usize, row: u32, col: usize },
#[error("shader preset parse error")]
ParserError {
offset: usize,
row: u32,
col: usize,
kind: ParseErrorKind,
},
#[error("invalid scale type")]
InvalidScaleType(String),
#[error("exceeded maximum reference depth (16)")]
ExceededReferenceDepth,
#[error("shader presets must be resolved against an absolute path")]
RootPathWasNotAbsolute,
#[error("the file was not found during resolution")]
IOError(PathBuf, std::io::Error),
#[error("expected utf8 bytes but got invalid utf8")]
Utf8Error(Vec<u8>),
}
#[derive(Debug)]
pub enum ParseErrorKind {
Index(&'static str),
Int,
UnsignedInt,
Float,
Bool,
}