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