MCPcopy Create free account
hub / github.com/archlinux/alpm / property_parser

Method property_parser

alpm-srcinfo/src/source_info/parser.rs:494–517  ·  view source on GitHub ↗

Recognizes keyword assignments in the `pkgbase` section in SRCINFO data. Since there're a lot of keywords and many of them are shared between the `pkgbase` and `pkgname` section, the keywords are bundled into somewhat logical groups. - [`SourceProperty`] are keywords that are related to the `source` keyword, such as checksums. - [`SharedMetaProperty`] are keywords that are related to general met

(input: &mut &str)

Source from the content-addressed store, hash-verified

492 .parse_next(input),
493 PackageBaseKeyword::SharedMeta(keyword) => SharedMetaProperty::parser(keyword)
494 .map(PackageBaseProperty::Meta)
495 .parse_next(input),
496 PackageBaseKeyword::Relation(keyword) => RelationProperty::parser(keyword)
497 .map(PackageBaseProperty::Relation)
498 .parse_next(input),
499 PackageBaseKeyword::Exclusive(keyword) => {
500 PackageBaseProperty::exclusive_property_parser(keyword).parse_next(input)
501 }
502 }
503 }
504
505 /// Recognizes keyword assignments exclusive to the `pkgbase` section in SRCINFO data.
506 ///
507 /// # Note
508 ///
509 /// This function relies on the keyword already having been parsed and expects it as parameter.
510 /// The cursor should be positioned right after the keyword.
511 fn exclusive_property_parser<'a>(
512 keyword: ExclusivePackageBaseKeyword,
513 ) -> impl Parser<Input<'a>, Self, ErrMode<ParseStack<'a>>> {
514 let parser = move |input: &mut Input<'a>| -> PResult<'a, Self> {
515 // Parse a possible architecture suffix for architecture specific fields.
516 let architecture = match keyword {
517 ExclusivePackageBaseKeyword::MakeDepends
518 | ExclusivePackageBaseKeyword::CheckDepends => {
519 architecture_suffix.parse_next(input)?
520 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected