MCPcopy Create free account
hub / github.com/csskit/csskit / has_distributable_group

Method has_distributable_group

crates/css_value_definition_parser/src/lib.rs:724–741  ·  view source on GitHub ↗
(def: &Def)

Source from the content-addressed store, hash-verified

722 }
723
724 fn has_distributable_group(def: &Def) -> bool {
725 match def {
726 Def::Combinator(children, DefCombinatorStyle::Ordered | DefCombinatorStyle::AllMustOccur) => {
727 let extractable: Vec<_> = children.iter().filter_map(Self::extract_alternatives).collect();
728 if extractable.is_empty() {
729 return false;
730 }
731 if extractable.len() == children.len() {
732 let first_alts = extractable[0].0;
733 if extractable.iter().all(|(alts, _)| *alts == first_alts) {
734 return false;
735 }
736 }
737 true
738 }
739 _ => false,
740 }
741 }
742
743 /// Returns the keyword name if `self` is a keyword-optional-prefixed ordered sequence:
744 /// either `Group(Ordered([Optional(Ident(kw)), ...]))` or a bare

Callers

nothing calls this directly

Calls 4

collectMethod · 0.80
iterMethod · 0.80
is_emptyMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected