aboutsummaryrefslogtreecommitdiff
path: root/crates/cfg
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-10-23 11:10:22 +0100
committerJonas Schievink <[email protected]>2020-10-23 11:12:03 +0100
commitdab8870f5c6d90ea1a327037825dc87a46778045 (patch)
tree90917852dc07cff5083048054d8f893307ed6224 /crates/cfg
parentbfe1efca26a9ae07d44ca3cc79ffdc4342f72b44 (diff)
Reorder items
Diffstat (limited to 'crates/cfg')
-rw-r--r--crates/cfg/src/dnf.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/cfg/src/dnf.rs b/crates/cfg/src/dnf.rs
index a08c307da..7ee7b0062 100644
--- a/crates/cfg/src/dnf.rs
+++ b/crates/cfg/src/dnf.rs
@@ -17,6 +17,15 @@ pub struct DnfExpr {
17 conjunctions: Vec<Conjunction>, 17 conjunctions: Vec<Conjunction>,
18} 18}
19 19
20struct Conjunction {
21 literals: Vec<Literal>,
22}
23
24struct Literal {
25 negate: bool,
26 var: Option<CfgAtom>, // None = Invalid
27}
28
20impl DnfExpr { 29impl DnfExpr {
21 pub fn new(expr: CfgExpr) -> Self { 30 pub fn new(expr: CfgExpr) -> Self {
22 let builder = Builder { expr: DnfExpr { conjunctions: Vec::new() } }; 31 let builder = Builder { expr: DnfExpr { conjunctions: Vec::new() } };
@@ -133,10 +142,6 @@ impl fmt::Display for DnfExpr {
133 } 142 }
134} 143}
135 144
136struct Conjunction {
137 literals: Vec<Literal>,
138}
139
140impl Conjunction { 145impl Conjunction {
141 fn new(parts: Vec<CfgExpr>) -> Self { 146 fn new(parts: Vec<CfgExpr>) -> Self {
142 let mut literals = Vec::new(); 147 let mut literals = Vec::new();
@@ -177,11 +182,6 @@ impl fmt::Display for Conjunction {
177 } 182 }
178} 183}
179 184
180struct Literal {
181 negate: bool,
182 var: Option<CfgAtom>, // None = Invalid
183}
184
185impl Literal { 185impl Literal {
186 fn new(expr: CfgExpr) -> Self { 186 fn new(expr: CfgExpr) -> Self {
187 match expr { 187 match expr {