impl Cp type
This commit is contained in:
@@ -5,9 +5,9 @@ use mon::{Parser, ParserIter, r#if, numeric1, one_of, tag};
|
||||
use crate::{
|
||||
Parseable,
|
||||
atom::{
|
||||
Atom, Blocker, Category, Cpv, Name, Slot, SlotName, SlotOperator, UseDep, UseDepCondition,
|
||||
UseDepNegate, UseDepSign, Version, VersionNumber, VersionNumbers, VersionOperator,
|
||||
VersionSuffix, VersionSuffixKind, VersionSuffixes,
|
||||
Atom, Blocker, Category, Cp, Cpv, Name, Slot, SlotName, SlotOperator, UseDep,
|
||||
UseDepCondition, UseDepNegate, UseDepSign, Version, VersionNumber, VersionNumbers,
|
||||
VersionOperator, VersionSuffix, VersionSuffixKind, VersionSuffixes,
|
||||
},
|
||||
useflag::UseFlag,
|
||||
};
|
||||
@@ -334,6 +334,16 @@ impl<'a> Parseable<'a, &'a str> for Atom {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Parseable<'a, &'a str> for Cp {
|
||||
type Parser = impl Parser<&'a str, Output = Self>;
|
||||
|
||||
fn parser() -> Self::Parser {
|
||||
Category::parser()
|
||||
.and(Name::parser().preceded_by(tag("/")))
|
||||
.map(|(category, name)| Cp { category, name })
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Parseable<'a, &'a str> for Cpv {
|
||||
type Parser = impl Parser<&'a str, Output = Self>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user