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

Method parse

crates/css_ast/src/rules/container/features.rs:101–111  ·  view source on GitHub ↗
(p: &mut Parser<'a, I>)

Source from the content-addressed store, hash-verified

99
100impl<'a> Parse<'a> for StyleFeature<'a> {
101 fn parse<I>(p: &mut Parser<'a, I>) -> ParserResult<Self>
102 where
103 I: Iterator<Item = Cursor> + Clone,
104 {
105 let c = p.peek_n(1);
106 if c == Kind::Ident && c.token().is_dashed_ident() && p.peek_n(2) != Kind::Colon {
107 return Ok(Self::CustomProperty(p.parse::<T![Ident]>()?));
108 }
109 let decl = p.parse::<Declaration<'a, StyleValue<'a>, CssMetadata>>()?;
110 Ok(Self::Declaration(BumpBox::new_in(p.bump(), decl)))
111 }
112}
113
114impl<'a> FeatureConditionList<'a> for StyleQuery<'a> {

Callers

nothing calls this directly

Calls 6

ErrClass · 0.85
peek_nMethod · 0.80
is_dashed_identMethod · 0.80
DeclarationClass · 0.50
tokenMethod · 0.45
bumpMethod · 0.45

Tested by

no test coverage detected