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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#[cfg(feature = "yaml-load")]
extern crate yaml_rust;
#[cfg(feature = "parsing")]
extern crate onig;
extern crate walkdir;
#[cfg(feature = "parsing")]
extern crate regex_syntax;
#[macro_use]
extern crate lazy_static;
extern crate plist;
#[cfg(any(feature = "dump-load-rs", feature = "dump-load", feature = "dump-create"))]
extern crate bincode;
#[macro_use]
extern crate bitflags;
#[cfg(any(feature = "dump-load", feature = "dump-create"))]
extern crate flate2;
#[cfg(any(feature = "dump-load-rs", feature = "dump-create-rs"))]
extern crate libflate;
#[cfg(feature = "parsing")]
extern crate fnv;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
pub mod highlighting;
pub mod parsing;
pub mod util;
#[cfg(any(feature = "dump-load-rs", feature = "dump-load", feature = "dump-create", feature = "dump-create-rs"))]
pub mod dumps;
#[cfg(feature = "parsing")]
pub mod easy;
#[cfg(feature = "html")]
pub mod html;
#[cfg(feature = "html")]
mod escape;
use std::io::Error as IoError;
#[cfg(all(feature = "yaml-load", feature = "parsing"))]
use parsing::ParseSyntaxError;
use highlighting::{ParseThemeError, SettingsError};
#[derive(Debug)]
pub enum LoadingError {
WalkDir(walkdir::Error),
Io(IoError),
#[cfg(feature = "yaml-load")]
ParseSyntax(ParseSyntaxError),
ParseTheme(ParseThemeError),
ReadSettings(SettingsError),
BadPath,
}
impl From<SettingsError> for LoadingError {
fn from(error: SettingsError) -> LoadingError {
LoadingError::ReadSettings(error)
}
}
impl From<IoError> for LoadingError {
fn from(error: IoError) -> LoadingError {
LoadingError::Io(error)
}
}
impl From<ParseThemeError> for LoadingError {
fn from(error: ParseThemeError) -> LoadingError {
LoadingError::ParseTheme(error)
}
}
#[cfg(all(feature = "yaml-load", feature = "parsing"))]
impl From<ParseSyntaxError> for LoadingError {
fn from(error: ParseSyntaxError) -> LoadingError {
LoadingError::ParseSyntax(error)
}
}