forked from gentoo-utils/gentoo-utils
impl profile evaluation
This commit is contained in:
13
src/repo/profile/package/parsers.rs
Normal file
13
src/repo/profile/package/parsers.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
use mon::{Parser, tag};
|
||||
|
||||
use crate::{Parseable, atom::Atom, repo::profile::package::Package};
|
||||
|
||||
impl<'a> Parseable<'a, &'a str> for Package {
|
||||
type Parser = impl Parser<&'a str, Output = Self>;
|
||||
|
||||
fn parser() -> Self::Parser {
|
||||
Atom::parser()
|
||||
.map(Package::Add)
|
||||
.or(Atom::parser().preceded_by(tag("-")).map(Package::Remove))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user