1 | mod edit;
|
2 | mod test;
|
3 |
|
4 | pub use self::edit::*;
|
5 | pub use self::test::*;
|
6 |
|
7 | #[derive (Clone, Debug, Default, PartialEq)]
|
8 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))]
|
9 | pub struct Match {
|
10 | pub target: MatchTarget,
|
11 | pub tests: Vec<Test>,
|
12 | pub edits: Vec<Edit>,
|
13 | }
|
14 |
|
15 | #[derive (Clone, Copy, Debug, PartialEq, Eq)]
|
16 | #[cfg_attr (feature = "serde" , derive(serde::Serialize, serde::Deserialize))]
|
17 | pub enum MatchTarget {
|
18 | Pattern,
|
19 | Font,
|
20 | Scan,
|
21 | }
|
22 |
|
23 | parse_enum! {
|
24 | MatchTarget,
|
25 | (Pattern, "pattern" ),
|
26 | (Font, "font" ),
|
27 | (Scan, "scan" ),
|
28 | }
|
29 |
|
30 | impl Default for MatchTarget {
|
31 | fn default() -> Self {
|
32 | MatchTarget::Pattern
|
33 | }
|
34 | }
|
35 | |